diff options
| author | Raymond Hettinger <python@rcn.com> | 2015-08-14 09:07:41 (GMT) |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2015-08-14 09:07:41 (GMT) |
| commit | 28c995d03b6e2f5a77c42a97e95368767846f14f (patch) | |
| tree | d0db53c0c671e3cdd65c6834ad58243a9e05227e /Modules/_collectionsmodule.c | |
| parent | 69082658122bba4ece22d8f3903808a738101fd5 (diff) | |
| download | cpython-28c995d03b6e2f5a77c42a97e95368767846f14f.zip cpython-28c995d03b6e2f5a77c42a97e95368767846f14f.tar.gz cpython-28c995d03b6e2f5a77c42a97e95368767846f14f.tar.bz2 | |
Minor cleanup.
Diffstat (limited to 'Modules/_collectionsmodule.c')
| -rw-r--r-- | Modules/_collectionsmodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 749cf6b..35034a5 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -2167,13 +2167,13 @@ _count_elements(PyObject *self, PyObject *args) oldval = _PyDict_GetItem_KnownHash(mapping, key, hash); if (oldval == NULL) { - if (_PyDict_SetItem_KnownHash(mapping, key, one, hash) == -1) + if (_PyDict_SetItem_KnownHash(mapping, key, one, hash) < 0) goto done; } else { newval = PyNumber_Add(oldval, one); if (newval == NULL) goto done; - if (_PyDict_SetItem_KnownHash(mapping, key, newval, hash) == -1) + if (_PyDict_SetItem_KnownHash(mapping, key, newval, hash) < 0) goto done; Py_CLEAR(newval); } @@ -2199,7 +2199,7 @@ _count_elements(PyObject *self, PyObject *args) Py_DECREF(oldval); if (newval == NULL) break; - if (PyObject_SetItem(mapping, key, newval) == -1) + if (PyObject_SetItem(mapping, key, newval) < 0) break; Py_CLEAR(newval); Py_DECREF(key); |
