]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: use CMP() macro at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Oct 2018 12:56:46 +0000 (21:56 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Oct 2018 12:56:46 +0000 (21:56 +0900)
src/test/test-prioq.c

index f7fb5ce42262c87c9462071150b74dd8bf11a6e0..57147a166fca2da6851f6fc21bcea58b41218a78 100644 (file)
@@ -54,13 +54,7 @@ struct test {
 static int test_compare(const void *a, const void *b) {
         const struct test *x = a, *y = b;
 
-        if (x->value < y->value)
-                return -1;
-
-        if (x->value > y->value)
-                return 1;
-
-        return 0;
+        return CMP(x->value, y->value);
 }
 
 static void test_hash(const void *a, struct siphash *state) {