From 6c8eaae1387f9739e56456c9574ec5435d240fe6 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 17 Jan 2007 16:58:51 -0500 Subject: Another application of Manuel Nova's "math instead of ifs" trick. Saves 17b. --- lib/bunzip.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/bunzip.c b/lib/bunzip.c index 74e7b172..9a0ec6d8 100644 --- a/lib/bunzip.c +++ b/lib/bunzip.c @@ -316,8 +316,7 @@ int read_bunzip_data(bunzip_data *bd) the basic or 0/1 method (except all bits 0, which would use no symbols, but a run of length 0 doesn't mean anything in this context). Thus space is saved. */ - if (nextSym == SYMBOL_RUNA) t += runPos; - else t += 2*runPos; + t += (runPos << nextSym); // +runPos if RUNA; +2*runPos if RUNB runPos <<= 1; continue; } -- cgit v1.2.3