summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-10-31 18:22:12 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-10-31 18:22:12 (GMT)
commit9892f52145a72729253c0e71790feef49d7892af (patch)
tree6a755db5537776ad20b066f2cc9c37a2ff637f11 /Objects/dictobject.c
parent37d2c99b2207a53a9cba3ac58dc82dab2356f5cb (diff)
downloadcpython-9892f52145a72729253c0e71790feef49d7892af.zip
cpython-9892f52145a72729253c0e71790feef49d7892af.tar.gz
cpython-9892f52145a72729253c0e71790feef49d7892af.tar.bz2
avoid a function call with redundant checks for dict size
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c2
1 files changed, 1 insertions, 1 deletions
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;