From dd8ed8204978edbbbf8379c09460b959315a5764 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 28 Feb 2021 18:41:30 -0800 Subject: [PATCH] undo another strcmp micro-optimization --- lib/gvpr/parse.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) 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, -- 2.40.0