mirror of
https://github.com/facebook/zstd.git
synced 2025-10-06 00:04:13 -04:00
Minor simplication: no longer need to check src size if using cardinality for minTableLog
This commit is contained in:
parent
75cd42afd7
commit
b34729018c
@ -1249,11 +1249,9 @@ unsigned HUF_cardinality(const unsigned* count, unsigned maxSymbolValue)
|
||||
|
||||
unsigned HUF_minTableLog(size_t srcSize, unsigned symbolCardinality)
|
||||
{
|
||||
U32 minBitsSrc = ZSTD_highbit32((U32)(srcSize)) + 1;
|
||||
U32 minBitsSymbols = ZSTD_highbit32(symbolCardinality) + 1;
|
||||
U32 minBits = minBitsSrc < minBitsSymbols ? minBitsSrc : minBitsSymbols;
|
||||
assert(srcSize > 1); /* Not supported, RLE should be used instead */
|
||||
return minBits;
|
||||
return minBitsSymbols;
|
||||
}
|
||||
|
||||
unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, void* workSpace, size_t wkspSize, HUF_CElt* table, const unsigned* count, HUF_depth_mode depthMode)
|
||||
|
Loading…
x
Reference in New Issue
Block a user