minor greedy mod

This commit is contained in:
Yann Collet 2015-11-06 11:48:56 +01:00
parent 805a52a773
commit 444873f494
2 changed files with 2 additions and 1 deletions

View File

@ -794,6 +794,7 @@ size_t ZSTD_HC_compressBlock_greedy(ZSTD_HC_CCtx* ctx, void* dst, size_t maxDstS
size_t offset=999999;
size_t matchLength = ZSTD_HC_HcFindBestMatch_selectMLS(ctx, ip, iend, &offset, maxSearches, mls);
if (!matchLength) { ip++; continue; }
while ((ip>anchor) && (ip-offset>ctx->base) && (ip[-1] == ip[-1-offset])) { ip--; } /* catch up */
/* store sequence */
{
size_t litLength = ip-anchor;

View File

@ -997,7 +997,7 @@ int main(int argc, char** argv)
argument++;
while ((*argument>= '0') && (*argument<='9'))
cLevel *= 10, cLevel += *argument++ - '0';
if (cLevel < 2) cLevel = 2;
if (cLevel < 1) cLevel = 1;
if (cLevel > ZSTD_HC_MAX_CLEVEL) cLevel = ZSTD_HC_MAX_CLEVEL;
g_params = g_seedParams[cLevel];
continue;