Conversation
instead of mlBase. This removes the need to do `- MINMATCH` at every call site. The new interface contract is checked with an `assert()`.
since this is effectively what is stored in this field (== matchLength - MINMATCH). This makes it clearer what needs to be done when reading from / writing to this field.
|
There is a second PR coming, focused on Unfortunately, the sum-type numeric representation is a leaky abstractions, with many subtle consequences throughout the code. Even when keeping ambitions low (i.e. not change behavior, just make the code clearer), the resulting PR is still complex, updating a lot of lines across many files. That's why this PR, focused on note : the lone failing test is just a CI issue, |
| U32 offset; /* offset == rawOffset + ZSTD_REP_NUM, or equivalently, offCode + 1 */ | ||
| U16 litLength; | ||
| U16 matchLength; | ||
| U16 mlBase; /* mlBase == matchLength - MINMATCH */ |
There was a problem hiding this comment.
Would a more natural name be mlCode, by analogy to offCode?
There was a problem hiding this comment.
mlCode is already taken,
it relates to the FSE code actually entropy-encoded.
mlBase is the starting value that leads to later transformation mlBase => mlCode + mlBits.
changed
ZSTD_storeSeq()interface to acceptmatchLengthinstead ofmlBaseas parameter.The new interface feels more logical, and removes the need to do
- MINMATCHat every call site.The new contract is checked with an
assert().Also : changed
seqDef.matchLengthintoseqDef.mlBasesince it more accurately describes what is stored in this field (
== matchLength - MINMATCH).