diff options
author | Chris Blume <cblume@google.com> | 2017-09-19 23:07:57 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2017-09-19 23:07:57 +0000 |
commit | 88885114a0cd9a224869fe0f29f62c1d52cb992b (patch) | |
tree | 7ff855f15dc82e140771ac42b6bde51eb69bf690 /inflate.c | |
parent | 567815a5e874d4d50c021069f4f855db23537747 (diff) | |
download | zlib-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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(); |