From: Yann Collet Date: Fri, 17 Nov 2017 23:51:52 +0000 (-0800) Subject: fix un-initialized memory warning X-Git-Tag: v1.3.3^2~38^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4a20a4b2f7f1ea9207cb5881d7271ed21913c8f;p=thirdparty%2Fzstd.git fix un-initialized memory warning harmless, but cleaner --- diff --git a/lib/compress/zstd_opt.c b/lib/compress/zstd_opt.c index aebe55f88..04f03ebcd 100644 --- a/lib/compress/zstd_opt.c +++ b/lib/compress/zstd_opt.c @@ -588,9 +588,8 @@ size_t ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx, while (mlen <= lastML) { U32 const pos = cur + mlen; U32 const price = basePrice + ZSTD_getPrice(optStatePtr, litlen, baseLiterals, offset, mlen, ultra); - assert(pos < ZSTD_OPT_NUM); - if ((pos > last_pos) | (price < opt[pos].price)) { + 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 */