mirror of
https://github.com/fluencelabs/redis
synced 2025-06-18 11:41:20 +00:00
Merge pull request #3828 from oranagra/sdsnewlen_pr
add SDS_NOINIT option to sdsnewlen to avoid unnecessary memsets.
This commit is contained in:
@ -98,7 +98,9 @@ robj *createEmbeddedStringObject(const char *ptr, size_t len) {
|
||||
sh->len = len;
|
||||
sh->alloc = len;
|
||||
sh->flags = SDS_TYPE_8;
|
||||
if (ptr) {
|
||||
if (ptr == SDS_NOINIT)
|
||||
sh->buf[len] = '\0';
|
||||
else if (ptr) {
|
||||
memcpy(sh->buf,ptr,len);
|
||||
sh->buf[len] = '\0';
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user