diff options
author | Raymond Hettinger <python@rcn.com> | 2004-03-19 10:30:00 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-03-19 10:30:00 (GMT) |
commit | 0690512a7d66dfdd8964e989e7cd1ea8f1d15228 (patch) | |
tree | 8ba74bf0302f72fecd5954bb06eb8009cc9f4205 /Objects | |
parent | 4a7ad1a27dae0d0884f04a8fd6d9b9f7a0c864c2 (diff) | |
download | cpython-0690512a7d66dfdd8964e989e7cd1ea8f1d15228.zip cpython-0690512a7d66dfdd8964e989e7cd1ea8f1d15228.tar.gz cpython-0690512a7d66dfdd8964e989e7cd1ea8f1d15228.tar.bz2 |
Factor out a double lookup.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/dictobject.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 7afc576..3e36961 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -1006,9 +1006,8 @@ dict_items(register dictobject *mp) ep = mp->ma_table; mask = mp->ma_mask; for (i = 0, j = 0; i <= mask; i++) { - if (ep[i].me_value != NULL) { + if ((value=ep[i].me_value) != NULL) { key = ep[i].me_key; - value = ep[i].me_value; item = PyList_GET_ITEM(v, j); Py_INCREF(key); PyTuple_SET_ITEM(item, 0, key); |