diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bunzip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bunzip.c b/lib/bunzip.c index 9a0ec6d8..982e1c51 100644 --- a/lib/bunzip.c +++ b/lib/bunzip.c @@ -346,7 +346,9 @@ int read_bunzip_data(bunzip_data *bd) if (dbufCount>=dbufSize) return RETVAL_DATA_ERROR; i = nextSym - 1; uc = mtfSymbol[i]; - memmove(mtfSymbol+1, mtfSymbol, i); + // On my laptop, unrolling this memmove() into a loop costs 11 bytes + // but shaves 3.5% off the total running time. + while(i--) mtfSymbol[i+1] = mtfSymbol[i]; mtfSymbol[0] = uc; uc = symToByte[uc]; |