From: Matthew Fernandez Date: Tue, 6 Jul 2021 00:03:13 +0000 (-0700) Subject: gxl2gv: move common agxset call outside conditional in setEdgeAttr X-Git-Tag: 2.48.0~3^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab133edf67cde817d332e1dfd9e0d1cb21387c55;p=graphviz gxl2gv: move common agxset call outside conditional in setEdgeAttr Every path through the conditional block in this code ends in the same agxset call. We can simplify this (and upcoming changes) by moving the common call outside the block. Related to #517. --- diff --git a/cmd/tools/gxl2gv.c b/cmd/tools/gxl2gv.c index 9a13c791a..1c421c6f5 100644 --- a/cmd/tools/gxl2gv.c +++ b/cmd/tools/gxl2gv.c @@ -338,7 +338,6 @@ setEdgeAttr(Agedge_t * ep, char *name, char *value, userdata_t * ud) ap = agattr(root, AGEDGE, attrname, 0); if (!ap) ap = agattr(root, AGEDGE, attrname, defval); - agxset(ep, ap, value); } else if (strcmp(name, "tailport") == 0) { if (ud->edgeinverted) attrname = "headport"; @@ -347,13 +346,13 @@ setEdgeAttr(Agedge_t * ep, char *name, char *value, userdata_t * ud) ap = agattr(root, AGEDGE, attrname, 0); if (!ap) ap = agattr(root, AGEDGE, attrname, defval); - agxset(ep, ap, value); } else { ap = agattr(root, AGEDGE, name, 0); if (!ap) ap = agattr(root, AGEDGE, name, defval); - agxset(ep, ap, value); } + + agxset(ep, ap, value); } /* setGlobalEdgeAttr: