Avoid Possibly Redundant Table Clears When Loading HC Dict
This commit is contained in:
parent
5076aa3e35
commit
fefc40fc0a
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user