assert(curr >= btLow);
assert(ip < iend); /* condition for ZSTD_count */
- while (nbCompares-- && (matchIndex > windowLow)) {
+ for (; nbCompares && (matchIndex > windowLow); --nbCompares) {
U32* const nextPtr = bt + 2*(matchIndex & btMask);
size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */
assert(matchIndex < curr);
(void)dictMode;
assert(dictMode == ZSTD_dictMatchState);
- while (nbCompares-- && (dictMatchIndex > dictLowLimit)) {
+ for (; nbCompares && (dictMatchIndex > dictLowLimit); --nbCompares) {
U32* const nextPtr = dictBt + 2*(dictMatchIndex & btMask);
size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */
const BYTE* match = dictBase + dictMatchIndex;
matchIndex = hashTable[h];
hashTable[h] = curr; /* Update Hash Table */
- while (nbCompares-- && (matchIndex > windowLow)) {
+ for (; nbCompares && (matchIndex > windowLow); --nbCompares) {
U32* const nextPtr = bt + 2*(matchIndex & btMask);
size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */
const BYTE* match;
*smallerPtr = *largerPtr = 0;
+ assert(nbCompares <= (1U << ZSTD_SEARCHLOG_MAX)); /* Check we haven't underflowed. */
if (dictMode == ZSTD_dictMatchState && nbCompares) {
bestLength = ZSTD_DUBT_findBetterDictMatch(
ms, ip, iend,
matchIndex = NEXT_IN_CHAIN(matchIndex, chainMask);
}
+ assert(nbAttempts <= (1U << ZSTD_SEARCHLOG_MAX)); /* Check we haven't underflowed. */
if (dictMode == ZSTD_dedicatedDictSearch) {
ml = ZSTD_dedicatedDictSearch_lazy_search(offsetPtr, ml, nbAttempts, dms,
ip, iLimit, prefixStart, curr, dictLimit, ddsIdx);
const U32 kMaxMatchEndPositionsToUpdate = 32;
if (useCache) {
- /* Only skip positions when using hash cache, i.e.
+ /* Only skip positions when using hash cache, i.e.
* if we are loading a dict, don't skip anything.
* If we decide to skip, then we only update a set number
* of positions at the beginning and end of the match.
}
}
+ assert(nbAttempts <= (1U << ZSTD_SEARCHLOG_MAX)); /* Check we haven't underflowed. */
if (dictMode == ZSTD_dedicatedDictSearch) {
ml = ZSTD_dedicatedDictSearch_lazy_search(offsetPtr, ml, nbAttempts + ddsExtraAttempts, dms,
ip, iLimit, prefixStart, curr, dictLimit, ddsIdx);
github, level 9, zstdcli, 137122
github, level 9 with dict, zstdcli, 41393
github, level 13, zstdcli, 136064
-github, level 13 with dict, zstdcli, 41743
+github, level 13 with dict, zstdcli, 41900
github, level 16, zstdcli, 136064
github, level 16 with dict, zstdcli, 39577
github, level 19, zstdcli, 136064
github, level 12 row 2 with dict copy, advanced one pass, 39677
github, level 12 row 2 with dict load, advanced one pass, 41166
github, level 13, advanced one pass, 134064
-github, level 13 with dict, advanced one pass, 39743
-github, level 13 with dict dms, advanced one pass, 39743
-github, level 13 with dict dds, advanced one pass, 39743
+github, level 13 with dict, advanced one pass, 39900
+github, level 13 with dict dms, advanced one pass, 39900
+github, level 13 with dict dds, advanced one pass, 39900
github, level 13 with dict copy, advanced one pass, 39948
github, level 13 with dict load, advanced one pass, 42626
github, level 16, advanced one pass, 134064
github.tar, level 12 row 2 with dict load, advanced one pass, 36459
github.tar, level 13, advanced one pass, 35501
github.tar, level 13 with dict, advanced one pass, 37130
-github.tar, level 13 with dict dms, advanced one pass, 37267
-github.tar, level 13 with dict dds, advanced one pass, 37267
+github.tar, level 13 with dict dms, advanced one pass, 37220
+github.tar, level 13 with dict dds, advanced one pass, 37220
github.tar, level 13 with dict copy, advanced one pass, 37130
github.tar, level 13 with dict load, advanced one pass, 36010
github.tar, level 16, advanced one pass, 40471
github, level 12 row 2 with dict copy, advanced one pass small out, 39677
github, level 12 row 2 with dict load, advanced one pass small out, 41166
github, level 13, advanced one pass small out, 134064
-github, level 13 with dict, advanced one pass small out, 39743
-github, level 13 with dict dms, advanced one pass small out, 39743
-github, level 13 with dict dds, advanced one pass small out, 39743
+github, level 13 with dict, advanced one pass small out, 39900
+github, level 13 with dict dms, advanced one pass small out, 39900
+github, level 13 with dict dds, advanced one pass small out, 39900
github, level 13 with dict copy, advanced one pass small out, 39948
github, level 13 with dict load, advanced one pass small out, 42626
github, level 16, advanced one pass small out, 134064
github.tar, level 12 row 2 with dict load, advanced one pass small out, 36459
github.tar, level 13, advanced one pass small out, 35501
github.tar, level 13 with dict, advanced one pass small out, 37130
-github.tar, level 13 with dict dms, advanced one pass small out, 37267
-github.tar, level 13 with dict dds, advanced one pass small out, 37267
+github.tar, level 13 with dict dms, advanced one pass small out, 37220
+github.tar, level 13 with dict dds, advanced one pass small out, 37220
github.tar, level 13 with dict copy, advanced one pass small out, 37130
github.tar, level 13 with dict load, advanced one pass small out, 36010
github.tar, level 16, advanced one pass small out, 40471
github, level 12 row 2 with dict copy, advanced streaming, 39677
github, level 12 row 2 with dict load, advanced streaming, 41166
github, level 13, advanced streaming, 134064
-github, level 13 with dict, advanced streaming, 39743
-github, level 13 with dict dms, advanced streaming, 39743
-github, level 13 with dict dds, advanced streaming, 39743
+github, level 13 with dict, advanced streaming, 39900
+github, level 13 with dict dms, advanced streaming, 39900
+github, level 13 with dict dds, advanced streaming, 39900
github, level 13 with dict copy, advanced streaming, 39948
github, level 13 with dict load, advanced streaming, 42626
github, level 16, advanced streaming, 134064
github.tar, level 12 row 2 with dict load, advanced streaming, 36459
github.tar, level 13, advanced streaming, 35501
github.tar, level 13 with dict, advanced streaming, 37130
-github.tar, level 13 with dict dms, advanced streaming, 37267
-github.tar, level 13 with dict dds, advanced streaming, 37267
+github.tar, level 13 with dict dms, advanced streaming, 37220
+github.tar, level 13 with dict dds, advanced streaming, 37220
github.tar, level 13 with dict copy, advanced streaming, 37130
github.tar, level 13 with dict load, advanced streaming, 36010
github.tar, level 16, advanced streaming, 40471
github, level 9, old streaming, 135122
github, level 9 with dict, old streaming, 39437
github, level 13, old streaming, 134064
-github, level 13 with dict, old streaming, 39743
+github, level 13 with dict, old streaming, 39900
github, level 16, old streaming, 134064
github, level 16 with dict, old streaming, 37577
github, level 19, old streaming, 134064
github, level 9, old streaming advanced, 138676
github, level 9 with dict, old streaming advanced, 38981
github, level 13, old streaming advanced, 138676
-github, level 13 with dict, old streaming advanced, 39721
+github, level 13 with dict, old streaming advanced, 39725
github, level 16, old streaming advanced, 138676
github, level 16 with dict, old streaming advanced, 40789
github, level 19, old streaming advanced, 134064
github, level 6 with dict, old streaming cdict, 38671
github, level 7 with dict, old streaming cdict, 38758
github, level 9 with dict, old streaming cdict, 39437
-github, level 13 with dict, old streaming cdict, 39743
+github, level 13 with dict, old streaming cdict, 39900
github, level 16 with dict, old streaming cdict, 37577
github, level 19 with dict, old streaming cdict, 37576
github, no source size with dict, old streaming cdict, 40654
github, level 6 with dict, old streaming advanced cdict, 39363
github, level 7 with dict, old streaming advanced cdict, 38924
github, level 9 with dict, old streaming advanced cdict, 38981
-github, level 13 with dict, old streaming advanced cdict, 39721
+github, level 13 with dict, old streaming advanced cdict, 39725
github, level 16 with dict, old streaming advanced cdict, 40789
github, level 19 with dict, old streaming advanced cdict, 37576
github, no source size with dict, old streaming advanced cdict, 40608