diff options
author | Raymond Hettinger <python@rcn.com> | 2015-05-11 17:32:57 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2015-05-11 17:32:57 (GMT) |
commit | a032e46df64330ec9e6e188d9ea53f594d0a0fbf (patch) | |
tree | 27a4557f9ff063c7ec8f1c478c0b78b392ac3960 | |
parent | bc33e57d56434d6feb99b77f10a3bc884f3a61ce (diff) | |
download | cpython-a032e46df64330ec9e6e188d9ea53f594d0a0fbf.zip cpython-a032e46df64330ec9e6e188d9ea53f594d0a0fbf.tar.gz cpython-a032e46df64330ec9e6e188d9ea53f594d0a0fbf.tar.bz2 |
Minor stylistic clean-up.
-rw-r--r-- | Modules/_heapqmodule.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c index 380489e..1ed6c2b 100644 --- a/Modules/_heapqmodule.c +++ b/Modules/_heapqmodule.c @@ -107,10 +107,10 @@ heappush(PyObject *self, PyObject *args) return NULL; } - if (PyList_Append(heap, item) == -1) + if (PyList_Append(heap, item)) return NULL; - if (siftdown((PyListObject *)heap, 0, PyList_GET_SIZE(heap)-1) == -1) + if (siftdown((PyListObject *)heap, 0, PyList_GET_SIZE(heap)-1)) return NULL; Py_RETURN_NONE; } @@ -148,7 +148,7 @@ heappop_internal(PyObject *heap, int siftup_func(PyListObject *, Py_ssize_t)) return lastelt; returnitem = PyList_GET_ITEM(heap, 0); PyList_SET_ITEM(heap, 0, lastelt); - if (siftup_func((PyListObject *)heap, 0) == -1) { + if (siftup_func((PyListObject *)heap, 0)) { Py_DECREF(returnitem); return NULL; } @@ -185,7 +185,7 @@ heapreplace_internal(PyObject *args, int siftup_func(PyListObject *, Py_ssize_t) returnitem = PyList_GET_ITEM(heap, 0); Py_INCREF(item); PyList_SET_ITEM(heap, 0, item); - if (siftup_func((PyListObject *)heap, 0) == -1) { + if (siftup_func((PyListObject *)heap, 0)) { Py_DECREF(returnitem); return NULL; } @@ -238,7 +238,7 @@ heappushpop(PyObject *self, PyObject *args) returnitem = PyList_GET_ITEM(heap, 0); Py_INCREF(item); PyList_SET_ITEM(heap, 0, item); - if (siftup((PyListObject *)heap, 0) == -1) { + if (siftup((PyListObject *)heap, 0)) { Py_DECREF(returnitem); return NULL; } @@ -341,7 +341,7 @@ heapify_internal(PyObject *heap, int siftup_func(PyListObject *, Py_ssize_t)) and that's again n//2-1. */ for (i=n/2-1 ; i>=0 ; i--) - if(siftup_func((PyListObject *)heap, i) == -1) + if(siftup_func((PyListObject *)heap, i)) return NULL; Py_RETURN_NONE; } |