aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-02-03 02:03:42 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-02-03 02:03:42 +0100
commit359230da8ea92d980ec2a852754e8e63aa893f73 (patch)
tree4263a8d8a614db1515c76558894fbf13886b3490
parente594fb2171a40d6d8f438140440b6c6b1dad5c41 (diff)
downloadbusybox-359230da8ea92d980ec2a852754e8e63aa893f73.tar.gz
bzip2: code shrink
function old new delta sendMTFValues 2111 2100 -11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--archival/libarchive/bz/compress.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/archival/libarchive/bz/compress.c b/archival/libarchive/bz/compress.c
index 534cf665a..992fd5884 100644
--- a/archival/libarchive/bz/compress.c
+++ b/archival/libarchive/bz/compress.c
@@ -289,11 +289,16 @@ void sendMTFValues(EState* s)
/*--- Decide how many coding tables to use ---*/
AssertH(s->nMTF > 0, 3001);
- if (s->nMTF < 200) nGroups = 2; else
- if (s->nMTF < 600) nGroups = 3; else
- if (s->nMTF < 1200) nGroups = 4; else
- if (s->nMTF < 2400) nGroups = 5; else
- nGroups = 6;
+ // 1..199 = 2
+ // 200..599 = 3
+ // 600..1199 = 4
+ // 1200..2399 = 5
+ // else 6
+ nGroups = 2;
+ nGroups += (s->nMTF >= 200);
+ nGroups += (s->nMTF >= 600);
+ nGroups += (s->nMTF >= 1200);
+ nGroups += (s->nMTF >= 2400);
/*--- Generate an initial set of coding tables ---*/
{