[Python-checkins] Fix issue 34551 - remove redundant store (#9009)

Łukasz Langa webhook-mailer at python.org
Mon Oct 22 15:27:27 EDT 2018


https://github.com/python/cpython/commit/5a95ba29da7e55fe6a8777b6ea4c68f60cf0e407
commit: 5a95ba29da7e55fe6a8777b6ea4c68f60cf0e407
branch: master
author: Eric Lippert <eric at lippert.com>
committer: Łukasz Langa <lukasz at langa.pl>
date: 2018-10-22T16:52:46+01:00
summary:

Fix issue 34551 - remove redundant store (#9009)

The assignment of i/2 to nk is redundant because on this code path, nk is already the size of the dictionary, and i is already twice the size of the dictionary. I've replaced the store with an assertion that i/2 is nk.

files:
M Objects/call.c

diff --git a/Objects/call.c b/Objects/call.c
index 1937a8b2278e..bda05738755a 100644
--- a/Objects/call.c
+++ b/Objects/call.c
@@ -352,7 +352,7 @@ _PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs
             Py_INCREF(k[i+1]);
             i += 2;
         }
-        nk = i / 2;
+        assert(i / 2 == nk);
     }
     else {
         kwtuple = NULL;



More information about the Python-checkins mailing list