diff options
author | W. Felix Handte <w@felixhandte.com> | 2018-04-27 18:10:27 (GMT) |
---|---|---|
committer | W. Felix Handte <w@felixhandte.com> | 2018-04-27 18:10:27 (GMT) |
commit | fefc40fc0afe8c1f5a02e65b94bb65515fd949c4 (patch) | |
tree | a211c8e34bb99490386d522d50900778ddedeab7 /lib | |
parent | 5076aa3e352ecbd67cd71314cb1fafcb319aed56 (diff) | |
download | lz4-fefc40fc0afe8c1f5a02e65b94bb65515fd949c4.zip lz4-fefc40fc0afe8c1f5a02e65b94bb65515fd949c4.tar.gz lz4-fefc40fc0afe8c1f5a02e65b94bb65515fd949c4.tar.bz2 |
Avoid Possibly Redundant Table Clears When Loading HC Dict
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lz4frame.c | 2 | ||||
-rw-r--r-- | lib/lz4hc.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c index c4e0ae0..8cf0c2f 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -472,7 +472,7 @@ LZ4F_CDict* LZ4F_createCDict(const void* dictBuffer, size_t dictSize) } memcpy(cdict->dictContent, dictStart, dictSize); LZ4_loadDict (cdict->fastCtx, (const char*)cdict->dictContent, (int)dictSize); - LZ4_resetStreamHC(cdict->HCCtx, LZ4HC_CLEVEL_DEFAULT); + LZ4_setCompressionLevel(cdict->HCCtx, LZ4HC_CLEVEL_DEFAULT); LZ4_loadDictHC(cdict->HCCtx, (const char*)cdict->dictContent, (int)dictSize); return cdict; } diff --git a/lib/lz4hc.c b/lib/lz4hc.c index 4126ef8..90f52f0 100644 --- a/lib/lz4hc.c +++ b/lib/lz4hc.c @@ -877,8 +877,8 @@ int LZ4_loadDictHC (LZ4_streamHC_t* LZ4_streamHCPtr, const char* dictionary, int dictionary += dictSize - 64 KB; dictSize = 64 KB; } + LZ4_resetStreamHC(LZ4_streamHCPtr, ctxPtr->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; |