diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-10-31 14:22:12 -0400 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-10-31 14:22:12 -0400 |
commit | e71aa63cb666eaddbe64932be4fed1dc65afec33 (patch) | |
tree | a6a8a3ebc45fe4f861ca475a6546b416937ac6ee /Objects/dictobject.c | |
parent | 7cd79a16c494ba7aedc551f9dfaf42351fe7b02c (diff) | |
download | cpython-e71aa63cb666eaddbe64932be4fed1dc65afec33.tar.gz |
avoid a function call with redundant checks for dict size
Diffstat (limited to 'Objects/dictobject.c')
-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 d3c5eac370..c10bfccdce 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; |