From: Lennart Poettering Date: Mon, 21 Dec 2015 18:53:41 +0000 (+0100) Subject: bitmap: don't do bitwise XOR on booleans X-Git-Tag: v231~830^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d7fa31c62242e11494ace491a8c98fb070d4e8a;p=platform%2Fupstream%2Fsystemd.git bitmap: don't do bitwise XOR on booleans 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. --- diff --git a/src/basic/bitmap.c b/src/basic/bitmap.c index c8b2427..5007882 100644 --- a/src/basic/bitmap.c +++ b/src/basic/bitmap.c @@ -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)