summaryrefslogtreecommitdiff
path: root/inffast.c
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2020-06-18 20:22:09 -0700
committerHans Kristian Rosbach <hk-github@circlestorm.org>2020-06-28 11:16:05 +0200
commit10be7c55f66e08f97c15afb5c5af985094155b5a (patch)
tree7311a43bb3c8c79d3825d9da65e932f256a732d5 /inffast.c
parente40d88adc9e8180969c6c56a0deb4ec69c3ec92b (diff)
Only calculate inflate chunk size once and store it for future use for performance.
Diffstat (limited to 'inffast.c')
-rw-r--r--inffast.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/inffast.c b/inffast.c
index 57d3ce4..27c29d9 100644
--- a/inffast.c
+++ b/inffast.c
@@ -270,7 +270,7 @@ void ZLIB_INTERNAL zng_inflate_fast(PREFIX3(stream) *strm, unsigned long start)
operations can write beyond `out+len` so long as they
stay within 258 bytes of `out`.
*/
- if (dist >= len || dist >= functable.chunksize())
+ if (dist >= len || dist >= state->chunksize)
out = functable.chunkcopy(out, out - dist, len);
else
out = functable.chunkmemset(out, dist, len);