summaryrefslogtreecommitdiff
path: root/inflate.c
diff options
context:
space:
mode:
authorChris Blume <cblume@google.com>2017-09-19 23:07:57 +0000
committerCommit Bot <commit-bot@chromium.org>2017-09-19 23:07:57 +0000
commit88885114a0cd9a224869fe0f29f62c1d52cb992b (patch)
tree7ff855f15dc82e140771ac42b6bde51eb69bf690 /inflate.c
parent567815a5e874d4d50c021069f4f855db23537747 (diff)
downloadzlib-88885114a0cd9a224869fe0f29f62c1d52cb992b.tar.gz
Zlib: Use defines for inffast
Zlib's inffast uses a handful of magic numbers. It would be easier to read and maintain if these magic numbers were instead #defines. NigelTao@ wrote this code to clean up the magic numbers in https://chromium-review.googlesource.com/c/chromium/src/+/601694 Nigel gave me permission to make a separate pull request to separate out just the magic number cleaning. BUG=764431 Change-Id: I0a62e31e98d4f3afcc64bd096e62a4b4b175644b Reviewed-on: https://chromium-review.googlesource.com/663424 Commit-Queue: Chris Blume <cblume@google.com> Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#502982} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 5d7c2b78db0e96c769dee8d4ed3a9aeac8ef21d5
Diffstat (limited to 'inflate.c')
-rw-r--r--inflate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/inflate.c b/inflate.c
index 69b769a..bec9497 100644
--- a/inflate.c
+++ b/inflate.c
@@ -1043,7 +1043,8 @@ int flush;
case LEN_:
state->mode = LEN;
case LEN:
- if (have >= 6 && left >= 258) {
+ if (have >= INFLATE_FAST_MIN_HAVE &&
+ left >= INFLATE_FAST_MIN_LEFT) {
RESTORE();
inflate_fast(strm, out);
LOAD();