1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

libdm: use dm_bit_get_last() in _stats_group_tag_fill()

Instead of iterating over all bits, use dm_bit_get_last() to find
the last set bit in the group bitmap.
This commit is contained in:
Bryn M. Reeves 2016-12-13 10:32:29 +00:00
parent 5d1d65e735
commit e8d966bc31

View File

@ -1716,9 +1716,7 @@ static size_t _stats_group_tag_fill(const struct dm_stats *dms,
int i, j, r, next, last = 0;
size_t used = 0;
i = dm_bit_get_first(regions);
for (; i >= 0; i = dm_bit_get_next(regions, i))
last = i;
last = dm_bit_get_last(regions);
i = dm_bit_get_first(regions);
for(; i >= 0; i = dm_bit_get_next(regions, i)) {