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) {
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) {