]> granicus.if.org Git - graphviz/commitdiff
circogen cmpDegree: abbreviate into early return style
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 20 Nov 2022 20:18:10 +0000 (12:18 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 24 Nov 2022 22:48:22 +0000 (14:48 -0800)
lib/circogen/deglist.c

index 3acaf7725bc325b098a41f884e15acd86d9e9e62..0a663628d3991203f865bfdea23fd6b43962eef9 100644 (file)
@@ -45,12 +45,13 @@ static int cmpDegree(Dt_t * d, int *key1, int *key2, Dtdisc_t * disc)
     (void)d;
     (void)disc;
 
-    if (*key1 < *key2)
+    if (*key1 < *key2) {
        return -1;
-    else if (*key1 > *key2)
+    }
+    if (*key1 > *key2) {
        return 1;
-    else
-       return 0;
+    }
+    return 0;
 }
 
 static Dtdisc_t nodeDisc = {