]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
minor CRatio improvement
authorYann Collet <yann.collet.73@gmail.com>
Fri, 6 Nov 2015 16:13:46 +0000 (17:13 +0100)
committerYann Collet <yann.collet.73@gmail.com>
Fri, 6 Nov 2015 16:13:46 +0000 (17:13 +0100)
lib/zstdhc.c

index a8e6631e8452bd6ea7777861ddcdd66d68fb318f..e2dfafc1de7fa5f8c56180bec182443d300a4048 100644 (file)
@@ -707,6 +707,8 @@ size_t ZSTD_HC_compressBlock_lazy_generic(ZSTD_HC_CCtx* ctx,
         }
 
         /* store sequence */
+        if (offset)
+        while ((start>anchor) && (start-offset>ctx->base) && (start[-1] == start[-1-offset])) { start--; matchLength++; }  /* catch up */
         {
             size_t litLength = start - anchor;
             if (offset) offset_1 = offset;