Short strings are packed quite tight in njs_value_t, so there's
no one more byte to test.
struct {
njs_value_type_t type:8;
uint8_t size:4;
uint8_t length:4;
u_char start[14];
} short_string;
With 14 bytes string this occupies 16 bytes, which is equal
to sizeof(njs_value_t).
start = value->short_string.start;
size = value->short_string.size;
- if (start[size] == '\0') {
- return start;
-
- } else if (size < NJS_STRING_SHORT) {
+ if (size < NJS_STRING_SHORT) {
start[size] = '\0';
return start;
}