Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28c995d

Browse files
committed
Minor cleanup.
1 parent 6908265 commit 28c995d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Modules/_collectionsmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,13 +2167,13 @@ _count_elements(PyObject *self, PyObject *args)
21672167

21682168
oldval = _PyDict_GetItem_KnownHash(mapping, key, hash);
21692169
if (oldval == NULL) {
2170-
if (_PyDict_SetItem_KnownHash(mapping, key, one, hash) == -1)
2170+
if (_PyDict_SetItem_KnownHash(mapping, key, one, hash) < 0)
21712171
goto done;
21722172
} else {
21732173
newval = PyNumber_Add(oldval, one);
21742174
if (newval == NULL)
21752175
goto done;
2176-
if (_PyDict_SetItem_KnownHash(mapping, key, newval, hash) == -1)
2176+
if (_PyDict_SetItem_KnownHash(mapping, key, newval, hash) < 0)
21772177
goto done;
21782178
Py_CLEAR(newval);
21792179
}
@@ -2199,7 +2199,7 @@ _count_elements(PyObject *self, PyObject *args)
21992199
Py_DECREF(oldval);
22002200
if (newval == NULL)
22012201
break;
2202-
if (PyObject_SetItem(mapping, key, newval) == -1)
2202+
if (PyObject_SetItem(mapping, key, newval) < 0)
22032203
break;
22042204
Py_CLEAR(newval);
22052205
Py_DECREF(key);

0 commit comments

Comments
 (0)