]> git.ipfire.org Git - thirdparty/git.git/blobdiff - ewah/bitmap.c
ewah: implement `bitmap_is_empty()`
[thirdparty/git.git] / ewah / bitmap.c
index 7b525b1ecd896e02dfa71cdf3aab75496d998fac..ac7e0af622a8fc74b678b57f464698d1bc9a45e7 100644 (file)
@@ -169,6 +169,15 @@ size_t bitmap_popcount(struct bitmap *self)
        return count;
 }
 
+int bitmap_is_empty(struct bitmap *self)
+{
+       size_t i;
+       for (i = 0; i < self->word_alloc; i++)
+               if (self->words[i])
+                       return 0;
+       return 1;
+}
+
 int bitmap_equals(struct bitmap *self, struct bitmap *other)
 {
        struct bitmap *big, *small;