Re:Do binary files contain more 1s or 0s?
by joezydeco on Tuesday November 12, 2019 @03:38PM
(#21517901)
Or a 255-entry precomputed lookup table.
256 entries
Re:Do binary files contain more 1s or 0s?
by joezydeco on Tuesday November 12, 2019 @03:43PM
(#21517970)
You can skip the lookup on a zero and do the dereference on a non-zero value.
You can, but that’ll cost you one extra branch, for nothing ;)
Personally I would probably have used shift for a simple script like this.