From: Yann Collet Date: Wed, 29 Nov 2017 00:08:43 +0000 (-0800) Subject: removed one invocation of SET_PRICE() macro X-Git-Tag: v1.3.3^2~23^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc42bc3b1dcfb0d9bcffa4e4710ac0dd42a3ec27;p=thirdparty%2Fzstd.git removed one invocation of SET_PRICE() macro --- diff --git a/lib/compress/zstd_opt.c b/lib/compress/zstd_opt.c index 6218d3682..d44b5be58 100644 --- a/lib/compress/zstd_opt.c +++ b/lib/compress/zstd_opt.c @@ -680,7 +680,12 @@ size_t ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx, if ((pos > last_pos) || (price < opt[pos].price)) { DEBUGLOG(7, "rPos:%u => new better price (%u<%u)", pos, price, opt[pos].price); - SET_PRICE(pos, mlen, offset, litlen, price, repHistory); /* note : macro modifies last_pos */ + while (last_pos < pos) { opt[last_pos+1].price = ZSTD_MAX_PRICE; last_pos++; } + opt[pos].mlen = mlen; + opt[pos].off = offset; + opt[pos].litlen = litlen; + opt[pos].price = price; + memcpy(opt[pos].rep, &repHistory, sizeof(repHistory)); } else { if (optLevel==0) break; /* gets ~+10% speed for about -0.01 ratio loss */ }