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:
parent
6aafa9483d
commit
05fb03beee
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user