Simpler loadDict() Reset

This commit is contained in:
W. Felix Handte 2018-04-20 19:37:28 -04:00
parent a8cb2feffd
commit fcc99d1f31

View File

@ -882,8 +882,8 @@ int LZ4_loadDictHC (LZ4_streamHC_t* LZ4_streamHCPtr, const char* dictionary, int
dictionary += dictSize - 64 KB;
dictSize = 64 KB;
}
LZ4_resetStreamHC(LZ4_streamHCPtr, LZ4_streamHCPtr->internal_donotuse.compressionLevel);
LZ4HC_init (ctxPtr, (const BYTE*)dictionary);
LZ4HC_clearTables (ctxPtr);
ctxPtr->end = (const BYTE*)dictionary + dictSize;
if (dictSize >= 4) LZ4HC_Insert (ctxPtr, ctxPtr->end-3);
return dictSize;