From: Matthew Fernandez Date: Mon, 1 Mar 2021 02:41:30 +0000 (-0800) Subject: undo another strcmp micro-optimization X-Git-Tag: 2.47.0~4^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd8ed8204978edbbbf8379c09460b959315a5764;p=graphviz undo another strcmp micro-optimization --- diff --git a/lib/gvpr/parse.c b/lib/gvpr/parse.c index ff7e5b9e1..c1dff3267 100644 --- a/lib/gvpr/parse.c +++ b/lib/gvpr/parse.c @@ -211,25 +211,18 @@ static case_t parseKind(Sfio_t * str) kwLine = lineno; parseID(str, c, buf, BSIZE); - switch (c) { - case 'B': - if (strcmp(buf, "BEGIN") == 0) - cs = Begin; - if (strcmp(buf, "BEG_G") == 0) - cs = BeginG; - break; - case 'E': - if (buf[1] == '\0') - cs = Edge; - if (strcmp(buf, "END") == 0) - cs = End; - if (strcmp(buf, "END_G") == 0) - cs = EndG; - break; - case 'N': - if (buf[1] == '\0') - cs = Node; - break; + if (strcmp(buf, "BEGIN") == 0) { + cs = Begin; + } else if (strcmp(buf, "BEG_G") == 0) { + cs = BeginG; + } else if (strcmp(buf, "E") == 0) { + cs = Edge; + } else if (strcmp(buf, "END") == 0) { + cs = End; + } else if (strcmp(buf, "END_G") == 0) { + cs = EndG; + } else if (strcmp(buf, "N") == 0) { + cs = Node; } if (cs == Error) error(ERROR_ERROR, "unexpected keyword \"%s\", line %d", buf,