]> granicus.if.org Git - graphviz/commitdiff
remove micro-optimization in streq()
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 22 Nov 2020 05:55:38 +0000 (21:55 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 23 Jan 2021 19:24:27 +0000 (11:24 -0800)
Modern compilers can already do tricks like this as they know strcmp() through
__builtin_strcmp().

lib/common/macros.h

index be1b5efa50abb2810a6e221e5711d6b5b872a595..7667193daf11fc4a77b246538df484a947b40999 100644 (file)
@@ -33,7 +33,7 @@
 #define EDGE_TYPE(g) (GD_flags(g) & (7 << 1))
 
 #ifndef streq
-#define streq(a,b)             (*(a)==*(b)&&!strcmp(a,b))
+#define streq(a,b)             (!strcmp(a,b))
 #endif
 
 #define XPAD(d) ((d).x += 4*GAP)