[Python-checkins] cpython (merge 3.6 -> default): Py_SIZE() was misused for dict.

serhiy.storchaka python-checkins at python.org
Fri Jan 13 01:38:38 EST 2017


https://hg.python.org/cpython/rev/aea6f93e2ee3
changeset:   106123:aea6f93e2ee3
parent:      106120:3493e2a109a5
parent:      106122:7f7f1cbbf608
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Jan 13 08:38:15 2017 +0200
summary:
  Py_SIZE() was misused for dict.

files:
  Modules/_json.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Modules/_json.c b/Modules/_json.c
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -1609,7 +1609,7 @@
         if (open_dict == NULL || close_dict == NULL || empty_dict == NULL)
             return -1;
     }
-    if (Py_SIZE(dct) == 0)
+    if (PyDict_GET_SIZE(dct) == 0)  /* Fast path */
         return _PyAccu_Accumulate(acc, empty_dict);
 
     if (s->markers != Py_None) {

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


More information about the Python-checkins mailing list