Merge pull request #3828 from oranagra/sdsnewlen_pr

add SDS_NOINIT option to sdsnewlen to avoid unnecessary memsets.
This commit is contained in:
Salvatore Sanfilippo
2018-02-27 04:04:32 -08:00
committed by GitHub
6 changed files with 19 additions and 11 deletions

View File

@ -759,7 +759,7 @@ int loadAppendOnlyFile(char *filename) {
}
if (buf[0] != '$') goto fmterr;
len = strtol(buf+1,NULL,10);
argsds = sdsnewlen(NULL,len);
argsds = sdsnewlen(SDS_NOINIT,len);
if (len && fread(argsds,len,1,fp) == 0) {
sdsfree(argsds);
fakeClient->argc = j; /* Free up to j-1. */