1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-29 04:55:36 +03: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:
Lennart Poettering 2015-07-23 04:51:57 +02:00
parent 6aafa9483d
commit 05fb03beee

View File

@ -140,12 +140,9 @@ bool bitmap_isclear(Bitmap *b) {
} }
void bitmap_clear(Bitmap *b) { void bitmap_clear(Bitmap *b) {
unsigned i;
assert(b); assert(b);
for (i = 0; i < b->n_bitmaps; i++) b->n_bitmaps = 0;
b->bitmaps[i] = 0;
} }
bool bitmap_iterate(Bitmap *b, Iterator *i, unsigned *n) { bool bitmap_iterate(Bitmap *b, Iterator *i, unsigned *n) {