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.
This commit is contained in:
parent
59332a3026
commit
232f1e261f
15
lib/lz4.c
15
lib/lz4.c
@ -1632,20 +1632,6 @@ LZ4_decompress_generic(
|
|||||||
|
|
||||||
/* partialDecoding : may not respect endBlock parsing restrictions */
|
/* partialDecoding : may not respect endBlock parsing restrictions */
|
||||||
assert(op<=oend);
|
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 (unlikely(offset<16)) {
|
||||||
if (offset < 8) {
|
if (offset < 8) {
|
||||||
op[0] = match[0];
|
op[0] = match[0];
|
||||||
@ -1858,7 +1844,6 @@ LZ4_decompress_generic(
|
|||||||
}
|
}
|
||||||
op = cpy; /* wildcopy correction */
|
op = cpy; /* wildcopy correction */
|
||||||
}
|
}
|
||||||
decode_done:
|
|
||||||
|
|
||||||
/* end of decoding */
|
/* end of decoding */
|
||||||
if (endOnInput)
|
if (endOnInput)
|
||||||
|
Loading…
Reference in New Issue
Block a user