• Kosta's avatar
    allow the short string optimization to store one more character · d2a374b4
    Kosta authored
    The `ShortString` can represent zero-terminated strings up to `MaxSize` chars (excluding the terminating zero) and store a value to determine the length of the contained string in the last character `str[LenPos]` by storing `MaxSize - length` there. If the string to store has the maximal length of `MaxSize` (excluding the terminating zero) then `str[LenPos]` will store `0` and therefore act as the string terminator as well. For getting the string length back from that value just use `MaxSize - str[LenPos]`.
    
    This allows to store `11`-chars strings in 32-bit mode and `15`-chars strings in 64-bit mode inline (for `UTF8`-encoded strings).
    d2a374b4
Name
Last commit
Last update
bin Loading commit data...
build Loading commit data...
doc Loading commit data...
example Loading commit data...
include/rapidjson Loading commit data...
test Loading commit data...
thirdparty Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.travis.yml Loading commit data...
license.txt Loading commit data...
readme.md Loading commit data...