Simpler loadDict() Reset
authorW. Felix Handte <w@felixhandte.com>
Fri, 20 Apr 2018 23:37:28 +0000 (19:37 -0400)
committerW. Felix Handte <w@felixhandte.com>
Fri, 20 Apr 2018 23:37:28 +0000 (19:37 -0400)
lib/lz4hc.c

index b70d03b..23d84f4 100644 (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;