Slightly improved decompression speed (linkedBlockMode, small frames primarily)
authorYann Collet <yann.collet.73@gmail.com>
Mon, 22 Sep 2014 01:02:40 +0000 (02:02 +0100)
committerYann Collet <yann.collet.73@gmail.com>
Mon, 22 Sep 2014 01:02:40 +0000 (02:02 +0100)
lz4frame.c

index d16a320..898978f 100644 (file)
@@ -873,7 +873,7 @@ size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext,
                        const LZ4F_decompressOptions_t* decompressOptionsPtr)
 {
     LZ4F_dctx_internal_t* dctxPtr = (LZ4F_dctx_internal_t*)decompressionContext;
-    LZ4F_decompressOptions_t optionsNull = { 0 };
+    static const LZ4F_decompressOptions_t optionsNull = { 0 };
     const BYTE* const srcStart = (const BYTE*)srcBuffer;
     const BYTE* const srcEnd = srcStart + *srcSizePtr;
     const BYTE* srcPtr = srcStart;
@@ -1210,6 +1210,7 @@ size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext,
     if ( (dctxPtr->frameInfo.blockMode==blockLinked)
        &&(dctxPtr->dict != dctxPtr->tmpOutBuffer)
        &&(!decompressOptionsPtr->stableDst)
+       &&((unsigned)(dctxPtr->dStage-1) < (unsigned)(dstage_getSuffix-1))
        )
     {
         if (dctxPtr->dStage == dstage_flushOut)