mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Use ffsl for a faster lesser_bitness function.
This commit is contained in:
parent
84e42de8da
commit
f792f72aa5
10
rzip.c
10
rzip.c
|
|
@ -343,13 +343,9 @@ static int minimum_bitness(struct rzip_state *st, tag t)
|
|||
* set than b? */
|
||||
static int lesser_bitness(tag a, tag b)
|
||||
{
|
||||
tag mask;
|
||||
|
||||
for (mask = 0; mask != (tag) - 1; mask = ((mask << 1) | 1)) {
|
||||
if ((a & b & mask) != mask)
|
||||
break;
|
||||
}
|
||||
return ((a & mask) < (b & mask));
|
||||
a ^= 0xffffffffffffffff;
|
||||
b ^= 0xffffffffffffffff;
|
||||
return (ffsll(a) < ffsll(b));
|
||||
}
|
||||
|
||||
/* If hash bucket is taken, we spill into next bucket(s). Secondary hashing
|
||||
|
|
|
|||
Loading…
Reference in a new issue