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

lib/common/colxlate.c

index 425cd8b735b3c8e18f3c1cf45a6379f8a30354a9..a17871f2717eb9a67c0414bd3bd9ac526b84151b 100644 (file)
@@ -379,7 +379,6 @@ int colorxlate(char *str, gvcolor_t * color, color_type_t target_type)
     if (!fake.name)
        return COLOR_MALLOC_FAIL;
     if ((last == NULL)
-       || (last->name[0] != fake.name[0])
        || (strcmp(last->name, fake.name))) {
        last = (hsvrgbacolor_t *) bsearch((void *) &fake,
                                      (void *) color_lib,