mirror of
https://github.com/facebook/zstd.git
synced 2025-10-18 00:03:50 -04:00
fixed dictionary generation, reported by Bartosz Taudul
This commit is contained in:
parent
ae40b18d55
commit
e0b4a2d40f
@ -332,12 +332,13 @@ static dictItem ZDICT_analyzePos(
|
|||||||
} while (length >=MINMATCHLENGTH);
|
} while (length >=MINMATCHLENGTH);
|
||||||
|
|
||||||
/* look backward */
|
/* look backward */
|
||||||
do {
|
length = MINMATCHLENGTH;
|
||||||
length = ZDICT_count(b + pos, b + suffix[start-1]);
|
while ((length >= MINMATCHLENGTH) & (start > 0)) {
|
||||||
if (length >= LLIMIT) length = LLIMIT-1;
|
length = ZDICT_count(b + pos, b + suffix[start - 1]);
|
||||||
lengthList[length]++;
|
if (length >= LLIMIT) length = LLIMIT - 1;
|
||||||
if (length >=MINMATCHLENGTH) start--;
|
lengthList[length]++;
|
||||||
} while(length >= MINMATCHLENGTH);
|
if (length >= MINMATCHLENGTH) start--;
|
||||||
|
}
|
||||||
|
|
||||||
/* largest useful length */
|
/* largest useful length */
|
||||||
memset(cumulLength, 0, sizeof(cumulLength));
|
memset(cumulLength, 0, sizeof(cumulLength));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user