Minor fix for non-rolling hash

dev
Stella Lau 2017-07-12 09:50:24 -07:00
parent 50502519fb
commit e0d4162464
1 changed files with 6 additions and 4 deletions

View File

@ -518,10 +518,11 @@ static void LDM_outputBlock(LDM_CCtx *cctx, const BYTE *match) {
while (cctx->ip < cctx->anchor + MINMATCH + matchLength + literalLength) { while (cctx->ip < cctx->anchor + MINMATCH + matchLength + literalLength) {
// printf("Loop\n"); // printf("Loop\n");
if (cctx->ip > cctx->lastPosHashed) { if (cctx->ip > cctx->lastPosHashed) {
LDM_updateLastHashFromNextHash(cctx);
// LDM_putHashOfCurrentPosition(cctx);
#ifdef LDM_ROLLING_HASH #ifdef LDM_ROLLING_HASH
LDM_updateLastHashFromNextHash(cctx);
LDM_setNextHash(cctx); LDM_setNextHash(cctx);
#else
LDM_putHashOfCurrentPosition(cctx);
#endif #endif
} }
/* /*
@ -594,9 +595,10 @@ size_t LDM_compress(const void *src, size_t srcSize,
// Set start of next block to current input pointer. // Set start of next block to current input pointer.
cctx.anchor = cctx.ip; cctx.anchor = cctx.ip;
#ifdef LDM_ROLLING_HASH
LDM_updateLastHashFromNextHash(&cctx); LDM_updateLastHashFromNextHash(&cctx);
// LDM_putHashOfCurrentPosition(&cctx); #else
#ifndef LDM_ROLLING_HASH LDM_putHashOfCurrentPosition(&cctx);
cctx.ip++; cctx.ip++;
#endif #endif