mirror of
https://github.com/systemd/systemd.git
synced 2026-08-05 07:30:30 +00:00
bitmap: bitmap_clear()
No need to actually reset the bitmap, we can just truncate it back zero size. That not only makes bitmap_clear() quicker, but also subsequent bitmap_isclear().
This commit is contained in:
@@ -140,12 +140,9 @@ bool bitmap_isclear(Bitmap *b) {
|
||||
}
|
||||
|
||||
void bitmap_clear(Bitmap *b) {
|
||||
unsigned i;
|
||||
|
||||
assert(b);
|
||||
|
||||
for (i = 0; i < b->n_bitmaps; i++)
|
||||
b->bitmaps[i] = 0;
|
||||
b->n_bitmaps = 0;
|
||||
}
|
||||
|
||||
bool bitmap_iterate(Bitmap *b, Iterator *i, unsigned *n) {
|
||||
|
||||
Reference in New Issue
Block a user