OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8aa0e94
)
Another application of Manuel Nova's "math instead of ifs" trick. Saves 17b.
author
Rob Landley
<rob@landley.net>
Wed, 17 Jan 2007 21:58:51 +0000
(16:58 -0500)
committer
Rob Landley
<rob@landley.net>
Wed, 17 Jan 2007 21:58:51 +0000
(16:58 -0500)
lib/bunzip.c
patch
|
blob
|
history
diff --git
a/lib/bunzip.c
b/lib/bunzip.c
index
74e7b17
..
9a0ec6d
100644
(file)
--- 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;
}