[systemd-commits] src/libsystemd-bus

Lennart Poettering lennart at kemper.freedesktop.org
Thu Oct 10 09:38:01 PDT 2013


 src/libsystemd-bus/sd-event.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit dfcd88f6347886f93973f810ee77a90685dda777
Author: Tero Roponen <tero.roponen at gmail.com>
Date:   Thu Oct 10 08:14:24 2013 +0300

    bus: fix duplicate comparisons
    
    Testing for y > x is the same as testing for x < y.

diff --git a/src/libsystemd-bus/sd-event.c b/src/libsystemd-bus/sd-event.c
index 069e4fb..de96fde 100644
--- a/src/libsystemd-bus/sd-event.c
+++ b/src/libsystemd-bus/sd-event.c
@@ -144,7 +144,7 @@ static int pending_prioq_compare(const void *a, const void *b) {
         /* Stability for the rest */
         if (x < y)
                 return -1;
-        if (y > x)
+        if (x > y)
                 return 1;
 
         return 0;
@@ -179,7 +179,7 @@ static int prepare_prioq_compare(const void *a, const void *b) {
         /* Stability for the rest */
         if (x < y)
                 return -1;
-        if (y > x)
+        if (x > y)
                 return 1;
 
         return 0;
@@ -212,7 +212,7 @@ static int time_prioq_compare(const void *a, const void *b) {
         /* Stability for the rest */
         if (x < y)
                 return -1;
-        if (y > x)
+        if (x > y)
                 return 1;
 
         return 0;



More information about the systemd-commits mailing list