Remove Redundant LZ4_resetStream() Call

This commit is contained in:
W. Felix Handte 2018-04-27 13:59:02 -04:00
parent 7d11e34413
commit 5076aa3e35

View File

@ -457,7 +457,7 @@ struct LZ4F_CDict_s {
LZ4F_CDict* LZ4F_createCDict(const void* dictBuffer, size_t dictSize)
{
const char* dictStart = (const char*)dictBuffer;
LZ4F_CDict* cdict = (LZ4F_CDict*) malloc(sizeof(*cdict));
LZ4F_CDict* cdict = (LZ4F_CDict*) ALLOC(sizeof(*cdict));
if (!cdict) return NULL;
if (dictSize > 64 KB) {
dictStart += dictSize - 64 KB;
@ -471,7 +471,6 @@ LZ4F_CDict* LZ4F_createCDict(const void* dictBuffer, size_t dictSize)
return NULL;
}
memcpy(cdict->dictContent, dictStart, dictSize);
LZ4_resetStream(cdict->fastCtx);
LZ4_loadDict (cdict->fastCtx, (const char*)cdict->dictContent, (int)dictSize);
LZ4_resetStreamHC(cdict->HCCtx, LZ4HC_CLEVEL_DEFAULT);
LZ4_loadDictHC(cdict->HCCtx, (const char*)cdict->dictContent, (int)dictSize);