Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a65ecb

Browse files
committed
Issue #26130: Remove redundant variable 's' from Parser/parser.c
Patch by Oren Milman.
1 parent 5a6c018 commit 2a65ecb

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

Parser/parser.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,20 @@ classify(parser_state *ps, int type, const char *str)
140140
int n = g->g_ll.ll_nlabels;
141141

142142
if (type == NAME) {
143-
const char *s = str;
144143
label *l = g->g_ll.ll_label;
145144
int i;
146145
for (i = n; i > 0; i--, l++) {
147146
if (l->lb_type != NAME || l->lb_str == NULL ||
148-
l->lb_str[0] != s[0] ||
149-
strcmp(l->lb_str, s) != 0)
147+
l->lb_str[0] != str[0] ||
148+
strcmp(l->lb_str, str) != 0)
150149
continue;
151150
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
152151
#if 0
153152
/* Leaving this in as an example */
154153
if (!(ps->p_flags & CO_FUTURE_WITH_STATEMENT)) {
155-
if (s[0] == 'w' && strcmp(s, "with") == 0)
154+
if (str[0] == 'w' && strcmp(str, "with") == 0)
156155
break; /* not a keyword yet */
157-
else if (s[0] == 'a' && strcmp(s, "as") == 0)
156+
else if (str[0] == 'a' && strcmp(str, "as") == 0)
158157
break; /* not a keyword yet */
159158
}
160159
#endif

0 commit comments

Comments
 (0)