diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-10-31 18:22:12 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-10-31 18:22:12 (GMT) |
commit | 9892f52145a72729253c0e71790feef49d7892af (patch) | |
tree | 6a755db5537776ad20b066f2cc9c37a2ff637f11 /Objects | |
parent | 37d2c99b2207a53a9cba3ac58dc82dab2356f5cb (diff) | |
download | cpython-9892f52145a72729253c0e71790feef49d7892af.zip cpython-9892f52145a72729253c0e71790feef49d7892af.tar.gz cpython-9892f52145a72729253c0e71790feef49d7892af.tar.bz2 |
avoid a function call with redundant checks for dict size
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/dictobject.c | 2 |
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; |