1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Minor optimalization of _test_word.

Skip ffs() if  (test >> bit) is 0.
This commit is contained in:
Zdenek Kabelac 2010-07-08 12:16:16 +00:00
parent 71082be43a
commit 981adf4837

View File

@ -69,9 +69,9 @@ void dm_bit_union(dm_bitset_t out, dm_bitset_t in1, dm_bitset_t in2)
static int _test_word(uint32_t test, int bit)
{
int next_set_bit;
uint32_t tb = test >> bit;
return ((next_set_bit = ffs(test >> bit)) ? next_set_bit + bit - 1 : -1);
return (tb ? ffs(tb) + bit - 1 : -1);
}
int dm_bit_get_next(dm_bitset_t bs, int last_bit)