Skip to content

Commit a032e46

Browse files
committed
Minor stylistic clean-up.
1 parent bc33e57 commit a032e46

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Modules/_heapqmodule.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ heappush(PyObject *self, PyObject *args)
107107
return NULL;
108108
}
109109

110-
if (PyList_Append(heap, item) == -1)
110+
if (PyList_Append(heap, item))
111111
return NULL;
112112

113-
if (siftdown((PyListObject *)heap, 0, PyList_GET_SIZE(heap)-1) == -1)
113+
if (siftdown((PyListObject *)heap, 0, PyList_GET_SIZE(heap)-1))
114114
return NULL;
115115
Py_RETURN_NONE;
116116
}
@@ -148,7 +148,7 @@ heappop_internal(PyObject *heap, int siftup_func(PyListObject *, Py_ssize_t))
148148
return lastelt;
149149
returnitem = PyList_GET_ITEM(heap, 0);
150150
PyList_SET_ITEM(heap, 0, lastelt);
151-
if (siftup_func((PyListObject *)heap, 0) == -1) {
151+
if (siftup_func((PyListObject *)heap, 0)) {
152152
Py_DECREF(returnitem);
153153
return NULL;
154154
}
@@ -185,7 +185,7 @@ heapreplace_internal(PyObject *args, int siftup_func(PyListObject *, Py_ssize_t)
185185
returnitem = PyList_GET_ITEM(heap, 0);
186186
Py_INCREF(item);
187187
PyList_SET_ITEM(heap, 0, item);
188-
if (siftup_func((PyListObject *)heap, 0) == -1) {
188+
if (siftup_func((PyListObject *)heap, 0)) {
189189
Py_DECREF(returnitem);
190190
return NULL;
191191
}
@@ -238,7 +238,7 @@ heappushpop(PyObject *self, PyObject *args)
238238
returnitem = PyList_GET_ITEM(heap, 0);
239239
Py_INCREF(item);
240240
PyList_SET_ITEM(heap, 0, item);
241-
if (siftup((PyListObject *)heap, 0) == -1) {
241+
if (siftup((PyListObject *)heap, 0)) {
242242
Py_DECREF(returnitem);
243243
return NULL;
244244
}
@@ -341,7 +341,7 @@ heapify_internal(PyObject *heap, int siftup_func(PyListObject *, Py_ssize_t))
341341
and that's again n//2-1.
342342
*/
343343
for (i=n/2-1 ; i>=0 ; i--)
344-
if(siftup_func((PyListObject *)heap, i) == -1)
344+
if(siftup_func((PyListObject *)heap, i))
345345
return NULL;
346346
Py_RETURN_NONE;
347347
}

0 commit comments

Comments
 (0)