bzip2: shrink makeMaps_e()
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 3 Feb 2018 14:31:54 +0000 (15:31 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 3 Feb 2018 14:31:54 +0000 (15:31 +0100)
function                                             old     new   delta
generateMTFValues                                    378     368     -10

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/libarchive/bz/compress.c

index 7efa533b0e727c3ca5859e4a3206d28abf381b04..0d083486bb78770ed60507e0f6471d03c9d76127 100644 (file)
@@ -146,13 +146,14 @@ static
 void makeMaps_e(EState* s)
 {
        int i;
-       s->nInUse = 0;
+       unsigned cnt = 0;
        for (i = 0; i < 256; i++) {
                if (s->inUse[i]) {
-                       s->unseqToSeq[i] = s->nInUse;
-                       s->nInUse++;
+                       s->unseqToSeq[i] = cnt;
+                       cnt++;
                }
        }
+       s->nInUse = cnt;
 }