From: Stella Lau Date: Wed, 12 Jul 2017 16:50:24 +0000 (-0700) Subject: Minor fix for non-rolling hash X-Git-Tag: v1.3.1^2~12^2~7^2~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0d416246403c6606bff15eb844b6c12155751de;p=thirdparty%2Fzstd.git Minor fix for non-rolling hash --- diff --git a/contrib/long_distance_matching/ldm.c b/contrib/long_distance_matching/ldm.c index 79648097a..a1fe6174b 100644 --- a/contrib/long_distance_matching/ldm.c +++ b/contrib/long_distance_matching/ldm.c @@ -518,10 +518,11 @@ static void LDM_outputBlock(LDM_CCtx *cctx, const BYTE *match) { while (cctx->ip < cctx->anchor + MINMATCH + matchLength + literalLength) { // printf("Loop\n"); if (cctx->ip > cctx->lastPosHashed) { - LDM_updateLastHashFromNextHash(cctx); -// LDM_putHashOfCurrentPosition(cctx); #ifdef LDM_ROLLING_HASH + LDM_updateLastHashFromNextHash(cctx); LDM_setNextHash(cctx); +#else + LDM_putHashOfCurrentPosition(cctx); #endif } /* @@ -594,9 +595,10 @@ size_t LDM_compress(const void *src, size_t srcSize, // Set start of next block to current input pointer. cctx.anchor = cctx.ip; +#ifdef LDM_ROLLING_HASH LDM_updateLastHashFromNextHash(&cctx); -// LDM_putHashOfCurrentPosition(&cctx); -#ifndef LDM_ROLLING_HASH +#else + LDM_putHashOfCurrentPosition(&cctx); cctx.ip++; #endif