]> granicus.if.org Git - graphviz/commitdiff
neatogen fcmpf: use early return style and add braces
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 3 Dec 2022 20:49:26 +0000 (12:49 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 3 Dec 2022 20:49:26 +0000 (12:49 -0800)
lib/neatogen/kkutils.c

index ac4e44bdb4b7daf3db651ba1a7f022df26cfe1bf..0aa316772b73777245e02018a2431bfdbf5c1b82 100644 (file)
@@ -180,9 +180,13 @@ fcmpf (int* ip1, int* ip2)
 {
     float d1 = fvals[*ip1];
     float d2 = fvals[*ip2];
-    if (d1 < d2) return -1;
-    else if (d1 > d2) return 1;
-    else return 0;
+    if (d1 < d2) {
+      return -1;
+    }
+    if (d1 > d2) {
+      return 1;
+    }
+    return 0;
 }
 
 void quicksort_placef(float *place, int *ordering, int first, int last)