bitmap: don't do bitwise XOR on booleans
authorLennart Poettering <lennart@poettering.net>
Mon, 21 Dec 2015 18:53:41 +0000 (19:53 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 26 Dec 2015 18:09:10 +0000 (19:09 +0100)
It's weird doing bitwise operations on booleans. Let's use the boolean
XOR (i.e. "!=") instead of the bitweise XOR (i.e. "^") on them.

src/basic/bitmap.c

index c8b2427..5007882 100644 (file)
@@ -200,7 +200,10 @@ bool bitmap_equal(Bitmap *a, Bitmap *b) {
         Bitmap *c;
         unsigned i;
 
-        if (!a ^ !b)
+        if (a == b)
+                return true;
+
+        if (!a != !b)
                 return false;
 
         if (!a)