]> granicus.if.org Git - graphviz/commitdiff
neatogen cmpItem: abbreviate and use early return style
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 18 Nov 2022 02:01:46 +0000 (18:01 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Nov 2022 05:29:08 +0000 (21:29 -0800)
lib/neatogen/multispline.c

index 14164fb1cd29d4ab2b208d426edc3ffbfbfad90e..efc46608b1f230d0f447ad867f2d89a548ac470e 100644 (file)
@@ -61,16 +61,11 @@ static int cmpItem(Dt_t * d, int p1[], int p2[], Dtdisc_t * disc)
     (void)d;
     (void)disc;
 
-    if (p1[0] < p2[0])
-       return -1;
-    else if (p1[0] > p2[0])
-       return 1;
-    else if (p1[1] < p2[1])
-       return -1;
-    else if (p1[1] > p2[1])
-       return 1;
-    else
-       return 0;
+    if (p1[0] < p2[0]) return -1;
+    if (p1[0] > p2[0]) return 1;
+    if (p1[1] < p2[1]) return -1;
+    if (p1[1] > p2[1]) return 1;
+    return 0;
 }
 
 /* newItem: