3 ms·
I wonder why they didn't make cut-off optimization points at 33? When programmers don't know in advance how long name/email/input/whatever field is going to be
by gesman 13y ago
I wonder why they didn't make cut-off optimization points at 33?
When programmers don't know in advance how long name/email/input/whatever field is going to be - they just use the magic "power of two" length :)
So 32 (or 33) in this case would be more reasonable.
- njharman 13y ago> When programmers don't know They did know. And there are many more cutoffs than powers of two, depending on storage backend.
- gliese1337 13y agoBecause of this line: #define RSTRING_EMBED_LEN_MAX ((int)((sizeof(VALUE)*3)/sizeof(char)-1)) 23 wasn't chosen, it was calculated to be the size that would be required for a struct describing a heap string, and will actually be a different number for different architectures. Choosing to make it bigger would add unnecessary overhead to the RString struct.