summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorW. Felix Handte <w@felixhandte.com>2018-03-26 15:43:52 (GMT)
committerW. Felix Handte <w@felixhandte.com>2018-04-20 00:54:35 (GMT)
commitb88a0b4e8812777d1e715ab095738197f7f8eb96 (patch)
tree6406f0c1a9302cd17f8a21d70342acf9478da988 /lib
parentb6c35ed6422f60a7a542ed237cadfd9dfe76c219 (diff)
downloadlz4-b88a0b4e8812777d1e715ab095738197f7f8eb96.zip
lz4-b88a0b4e8812777d1e715ab095738197f7f8eb96.tar.gz
lz4-b88a0b4e8812777d1e715ab095738197f7f8eb96.tar.bz2
Only Perform Dict Lookup if Attempts Remain
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4hc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index 0caf001..e005cd7 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -288,7 +288,7 @@ LZ4HC_InsertAndGetWiderMatch (
} } } }
} /* while ((matchIndex>=lowLimit) && (matchIndex < (ip - base)) && (nbAttempts)) */
- if (dictCtx != NULL) {
+ if (dictCtx != NULL && nbAttempts) {
ptrdiff_t dictIndexDelta = dictCtx->base - dictCtx->end + lowLimit;
dictMatchIndex = dictCtx->hashTable[LZ4HC_hashPtr(ip)];
matchIndex = dictMatchIndex + dictIndexDelta;