From: Yann Collet Date: Wed, 10 Feb 2016 16:18:24 +0000 (+0100) Subject: restored fast zstd_opt variant X-Git-Tag: v0.5.1^2~3^2~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=490aa68b1809ad10807a92a833e9b21ca2171cf4;p=thirdparty%2Fzstd.git restored fast zstd_opt variant --- diff --git a/lib/zstd_opt.h b/lib/zstd_opt.h index 579558b11..6fb94e21a 100644 --- a/lib/zstd_opt.h +++ b/lib/zstd_opt.h @@ -350,8 +350,8 @@ U32 ZSTD_HcGetAllMatches_generic ( nbAttempts--; if ((!extDict) || matchIndex >= dictLimit) { match = base + matchIndex; - //if (match[minml] == ip[minml]) currentMl = ZSTD_count(ip, match, iHighLimit); if (currentMl>0) { // faster - if (MEM_read32(match) == MEM_read32(ip)) { currentMl = ZSTD_count(ip+MINMATCH, match+MINMATCH, iHighLimit)+MINMATCH; // stronger + if (match[minml] == ip[minml]) currentMl = ZSTD_count(ip, match, iHighLimit); if (currentMl>0) { // faster + //if (MEM_read32(match) == MEM_read32(ip)) { currentMl = ZSTD_count(ip+MINMATCH, match+MINMATCH, iHighLimit)+MINMATCH; // stronger while ((match-back > base) && (ip-back > iLowLimit) && (ip[-back-1] == match[-back-1])) back++; currentMl += back; }