diff options
author | Denys Vlasenko | 2018-02-03 01:30:12 +0100 |
---|---|---|
committer | Denys Vlasenko | 2018-02-03 01:30:12 +0100 |
commit | e594fb2171a40d6d8f438140440b6c6b1dad5c41 (patch) | |
tree | a3ef3ae4a472bd7b76496ec386a0fcc7a4226004 /archival/libarchive/bz/compress.c | |
parent | 125c3ff4b10ee36b757924b3c55b3ac34e902120 (diff) | |
download | busybox-e594fb2171a40d6d8f438140440b6c6b1dad5c41.zip busybox-e594fb2171a40d6d8f438140440b6c6b1dad5c41.tar.gz |
bzip2: code shrink
function old new delta
BZ2_compressBlock 225 230 +5
handle_compress 356 355 -1
bsW16 59 56 -3
bsW 64 61 -3
bsFinishWrite 37 32 -5
prepare_new_block 48 34 -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/5 up/down: 5/-26) Total: -21 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libarchive/bz/compress.c')
-rw-r--r-- | archival/libarchive/bz/compress.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/archival/libarchive/bz/compress.c b/archival/libarchive/bz/compress.c index c640173..534cf66 100644 --- a/archival/libarchive/bz/compress.c +++ b/archival/libarchive/bz/compress.c @@ -50,8 +50,7 @@ static NOINLINE void bsFinishWrite(EState* s) { while (s->bsLive > 0) { - s->zbits[s->numZ] = (uint8_t)(s->bsBuff >> 24); - s->numZ++; + *s->posZ++ = (uint8_t)(s->bsBuff >> 24); s->bsBuff <<= 8; s->bsLive -= 8; } @@ -67,8 +66,7 @@ ALWAYS_INLINE void bsW(EState* s, int32_t n, uint32_t v) { while (s->bsLive >= 8) { - s->zbits[s->numZ] = (uint8_t)(s->bsBuff >> 24); - s->numZ++; + *s->posZ++ = (uint8_t)(s->bsBuff >> 24); s->bsBuff <<= 8; s->bsLive -= 8; } @@ -83,8 +81,7 @@ ALWAYS_INLINE void bsW16(EState* s, uint32_t v) { while (s->bsLive >= 8) { - s->zbits[s->numZ] = (uint8_t)(s->bsBuff >> 24); - s->numZ++; + *s->posZ++ = (uint8_t)(s->bsBuff >> 24); s->bsBuff <<= 8; s->bsLive -= 8; } @@ -624,12 +621,14 @@ void BZ2_compressBlock(EState* s, int is_last_block) s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31); s->combinedCRC ^= s->blockCRC; if (s->blockNo > 1) - s->numZ = 0; + s->posZ = s->zbits; // was: s->numZ = 0; BZ2_blockSort(s); } s->zbits = &((uint8_t*)s->arr2)[s->nblock]; + s->posZ = s->zbits; + s->state_out_pos = s->zbits; /*-- If this is the first block, create the stream header. --*/ if (s->blockNo == 1) { |