[Python-checkins] cpython: Issue #26130: Remove redundant variable 's' from Parser/parser.c

berker.peksag python-checkins at python.org
Sun Mar 27 17:43:31 EDT 2016


https://hg.python.org/cpython/rev/a90f5e2b7160
changeset:   100775:a90f5e2b7160
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Mon Mar 28 00:45:28 2016 +0300
summary:
  Issue #26130: Remove redundant variable 's' from Parser/parser.c

Patch by Oren Milman.

files:
  Parser/parser.c |  9 ++++-----
  1 files changed, 4 insertions(+), 5 deletions(-)


diff --git a/Parser/parser.c b/Parser/parser.c
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -140,21 +140,20 @@
     int n = g->g_ll.ll_nlabels;
 
     if (type == NAME) {
-        const char *s = str;
         label *l = g->g_ll.ll_label;
         int i;
         for (i = n; i > 0; i--, l++) {
             if (l->lb_type != NAME || l->lb_str == NULL ||
-                l->lb_str[0] != s[0] ||
-                strcmp(l->lb_str, s) != 0)
+                l->lb_str[0] != str[0] ||
+                strcmp(l->lb_str, str) != 0)
                 continue;
 #ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
 #if 0
             /* Leaving this in as an example */
             if (!(ps->p_flags & CO_FUTURE_WITH_STATEMENT)) {
-                if (s[0] == 'w' && strcmp(s, "with") == 0)
+                if (str[0] == 'w' && strcmp(str, "with") == 0)
                     break; /* not a keyword yet */
-                else if (s[0] == 'a' && strcmp(s, "as") == 0)
+                else if (str[0] == 'a' && strcmp(str, "as") == 0)
                     break; /* not a keyword yet */
             }
 #endif

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list