]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
restore full equation 4232/head
authorYann Collet <yann.collet.73@gmail.com>
Tue, 14 Jan 2025 23:57:05 +0000 (15:57 -0800)
committerYann Collet <cyan@fb.com>
Thu, 16 Jan 2025 01:11:27 +0000 (17:11 -0800)
do not solve the equation, even though some members cancel each other,
this is done for clarity,
we'll let the compiler do the resolution at compile time.

lib/compress/zstd_compress.c

index eba2d07dcf565bd3d414e2d8de10abde4ef4beef..e26e78a8f7f114411414f9569294237cbcd5778c 100644 (file)
@@ -7342,7 +7342,7 @@ size_t ZSTD_convertBlockSequences(ZSTD_CCtx* cctx,
                 DEBUGLOG(5, "long literals length detected at pos %zu", longl-nbSequences);
                 assert(longl <= 2* (nbSequences-1));
                 cctx->seqStore.longLengthType = ZSTD_llt_literalLength;
-                cctx->seqStore.longLengthPos = (U32)(longl-nbSequences);
+                cctx->seqStore.longLengthPos = (U32)(longl-(nbSequences-1)-1);
             }
         }
     } else {