From 6921c13bbbb2c9695edd87331d98f7aa1e48f7f2 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 21 Mar 2015 02:03:40 -0700 Subject: Minor nit. Make the rotate() success/fail tests consistent. --- Modules/_collectionsmodule.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 28aacc3..b831627 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -634,7 +634,7 @@ deque_rotate(dequeobject *deque, PyObject *args) if (!PyArg_ParseTuple(args, "|n:rotate", &n)) return NULL; - if (_deque_rotate(deque, n) == 0) + if (!_deque_rotate(deque, n)) Py_RETURN_NONE; return NULL; } @@ -864,7 +864,7 @@ deque_remove(dequeobject *deque, PyObject *value) if (cmp > 0) { PyObject *tgt = deque_popleft(deque, NULL); assert (tgt != NULL); - if (_deque_rotate(deque, i) == -1) + if (_deque_rotate(deque, i)) return NULL; Py_DECREF(tgt); Py_RETURN_NONE; @@ -959,7 +959,7 @@ deque_del_item(dequeobject *deque, Py_ssize_t i) int rv; assert (i >= 0 && i < Py_SIZE(deque)); - if (_deque_rotate(deque, -i) == -1) + if (_deque_rotate(deque, -i)) return -1; item = deque_popleft(deque, NULL); rv = _deque_rotate(deque, i); -- cgit v0.12