]> granicus.if.org Git - graphviz/commitdiff
rgb2cmyk: call fmin instead of open coding floating point comparison
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 29 Aug 2021 22:07:48 +0000 (15:07 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 4 Sep 2021 02:26:35 +0000 (19:26 -0700)
lib/common/colxlate.c

index 98d57dc565ee28294270888fc64b596549cbf890..7d3197dd81283627304ad216004ac117ff1549c5 100644 (file)
@@ -117,8 +117,8 @@ static void rgb2cmyk(double r, double g, double b, double *c, double *m,
     *c = 1.0 - r;
     *m = 1.0 - g;
     *y = 1.0 - b;
-    *k = *c < *m ? *c : *m;
-    *k = *y < *k ? *y : *k;
+    *k = fmin(*c, *m);
+    *k = fmin(*y, *k);
     *c -= *k;
     *m -= *k;
     *y -= *k;