From 9892f52145a72729253c0e71790feef49d7892af Mon Sep 17 00:00:00 2001
From: Benjamin Peterson <benjamin@python.org>
Date: Wed, 31 Oct 2012 14:22:12 -0400
Subject: avoid a function call with redundant checks for dict size

---
 Objects/dictobject.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index d3c5eac..c10bfcc 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1335,7 +1335,7 @@ dict_fromkeys(PyObject *cls, PyObject *args)
     if (d == NULL)
         return NULL;
 
-    if (PyDict_CheckExact(d) && PyDict_Size(d) == 0) {
+    if (PyDict_CheckExact(d) && ((PyDictObject *)d)->ma_used == 0) {
         if (PyDict_CheckExact(seq)) {
             PyDictObject *mp = (PyDictObject *)d;
             PyObject *oldvalue;
-- 
cgit v0.12

