]> granicus.if.org Git - graphviz/commitdiff
colorxlate: remove strcmp micro-optimization
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 29 Aug 2021 23:17:17 +0000 (16:17 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 4 Sep 2021 02:26:35 +0000 (19:26 -0700)
This is unnecessary when using a modern compiler.

cmd/tools/colxlate.c

index 414e3bf0f70df56737bcbc2a7129c82ea7673a6a..bea203e6ee40743919e08510085d0a2b5ffb577a 100644 (file)
@@ -72,7 +72,7 @@ char *colorxlate(char *str, char *buf)
     char *p;
     hsbcolor_t fake;
 
-    if ((last == NULL) || (last->name[0] != str[0])
+    if ((last == NULL)
        || (strcmp(last->name, str))) {
        fake.name = (char *) canoncolor(str, canon);
        last = bsearch(&fake, color_lib, sizeof(color_lib) / sizeof(hsbcolor_t),