From 232f1e261fce421542e0cf7549f25e3064006bf0 Mon Sep 17 00:00:00 2001 From: Dave Watson Date: Fri, 25 Jan 2019 14:47:15 -0800 Subject: decompress_generic: drop partial copy check in fast loop We've already checked that we are more than FASTLOOP_SAFE_DISTANCE away from the end, so this branch can never be true, we will have already jumped to the second decode loop. --- lib/lz4.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/lib/lz4.c b/lib/lz4.c index 978a957..915ee74 100644 --- a/lib/lz4.c +++ b/lib/lz4.c @@ -1632,20 +1632,6 @@ LZ4_decompress_generic( /* partialDecoding : may not respect endBlock parsing restrictions */ assert(op<=oend); - if (partialDecoding && (cpy > oend-MATCH_SAFEGUARD_DISTANCE)) { - size_t const mlen = MIN(length, (size_t)(oend-op)); - const BYTE* const matchEnd = match + mlen; - BYTE* const copyEnd = op + mlen; - if (matchEnd > op) { /* overlap copy */ - while (op < copyEnd) *op++ = *match++; - } else { - memcpy(op, match, mlen); - } - op = copyEnd; - if (op==oend) goto decode_done; - continue; - } - if (unlikely(offset<16)) { if (offset < 8) { op[0] = match[0]; @@ -1858,7 +1844,6 @@ LZ4_decompress_generic( } op = cpy; /* wildcopy correction */ } - decode_done: /* end of decoding */ if (endOnInput) -- cgit v0.12