]> granicus.if.org Git - graphviz/commitdiff
mark verbose reporting in gvParseArgs as unlikely
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 21 Jun 2021 00:44:59 +0000 (17:44 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Jun 2021 17:34:42 +0000 (10:34 -0700)
This indicates to the compiler it should predict the condition of this branch as
false in its optimization choices.

lib/common/args.c

index 9ee5291c0582fe313e83749c8617468524c5fbb8..1a603fe76dee6f778229b7e442c0a497012b6641 100644 (file)
@@ -17,6 +17,7 @@
  * Needs to be fixed before layout engines can be plugins.
  */
 
+#include <cgraph/likely.h>
 #include <ctype.h>
 #include <common/render.h>
 #include <fdpgen/tlayout.h>
@@ -279,7 +280,7 @@ int gvParseArgs(GVC_t *gvc, int argc, char** argv)
        return (1-argc);
     if ((rv = dotneato_args_initialize(gvc, argc, argv)))
        return rv;
-    if (Verbose)
+    if (UNLIKELY(Verbose))
        gvplugin_write_status(gvc);
     return 0;
 }