From: Matthew Fernandez Date: Fri, 18 Nov 2022 02:01:46 +0000 (-0800) Subject: neatogen cmpItem: abbreviate and use early return style X-Git-Tag: 7.0.3~11^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ee67228d381b266fa8a0cc2009cac6417343677;p=graphviz neatogen cmpItem: abbreviate and use early return style --- diff --git a/lib/neatogen/multispline.c b/lib/neatogen/multispline.c index 14164fb1c..efc46608b 100644 --- a/lib/neatogen/multispline.c +++ b/lib/neatogen/multispline.c @@ -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: