summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-09-22 01:02:40 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-09-22 01:02:40 (GMT)
commitff670f659a25160d6fc396842db67b241ba6bd9e (patch)
treeb639bdcc0f63fb8d1906151ecc030ec2470eea42
parent4e92d7e412760eda8edb0cc2159c9372e3a61889 (diff)
downloadlz4-ff670f659a25160d6fc396842db67b241ba6bd9e.zip
lz4-ff670f659a25160d6fc396842db67b241ba6bd9e.tar.gz
lz4-ff670f659a25160d6fc396842db67b241ba6bd9e.tar.bz2
Slightly improved decompression speed (linkedBlockMode, small frames primarily)
-rw-r--r--lz4frame.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lz4frame.c b/lz4frame.c
index d16a320..898978f 100644
--- a/lz4frame.c
+++ b/lz4frame.c
@@ -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)