fixed remaining searchLength invocations

This commit is contained in:
Yann Collet
2018-11-20 15:13:27 -08:00
parent e874dacc08
commit 2e7fd6a2cb
10 changed files with 76 additions and 40 deletions
+4 -4
View File
@@ -255,7 +255,7 @@ static dictItem ZDICT_analyzePos(
}
{ int i;
U32 searchLength;
U32 mml;
U32 refinedStart = start;
U32 refinedEnd = end;
@@ -263,7 +263,7 @@ static dictItem ZDICT_analyzePos(
DISPLAYLEVEL(4, "found %3u matches of length >= %i at pos %7u ", (U32)(end-start), MINMATCHLENGTH, (U32)pos);
DISPLAYLEVEL(4, "\n");
for (searchLength = MINMATCHLENGTH ; ; searchLength++) {
for (mml = MINMATCHLENGTH ; ; mml++) {
BYTE currentChar = 0;
U32 currentCount = 0;
U32 currentID = refinedStart;
@@ -271,13 +271,13 @@ static dictItem ZDICT_analyzePos(
U32 selectedCount = 0;
U32 selectedID = currentID;
for (id =refinedStart; id < refinedEnd; id++) {
if (b[suffix[id] + searchLength] != currentChar) {
if (b[suffix[id] + mml] != currentChar) {
if (currentCount > selectedCount) {
selectedCount = currentCount;
selectedID = currentID;
}
currentID = id;
currentChar = b[ suffix[id] + searchLength];
currentChar = b[ suffix[id] + mml];
currentCount = 0;
}
currentCount ++;