Improve lzjb decompress performance by reorganizing the code
to tighten the copy loop. Submitted by: Denis Ahrens <denis h3q com> MFC after: 2 weeks Approved by: re (gjb)
This commit is contained in:
parent
64db896617
commit
6eb151f212
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=256132
@ -117,7 +117,9 @@ lzjb_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
|
||||
src += 2;
|
||||
if ((cpy = dst - offset) < (uchar_t *)d_start)
|
||||
return (-1);
|
||||
while (--mlen >= 0 && dst < d_end)
|
||||
if (mlen > (d_end - dst))
|
||||
mlen = d_end - dst;
|
||||
while (--mlen >= 0)
|
||||
*dst++ = *cpy++;
|
||||
} else {
|
||||
*dst++ = *src++;
|
||||
|
Loading…
Reference in New Issue
Block a user