diff options
author | Raymond Hettinger <python@rcn.com> | 2015-03-21 09:03:40 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2015-03-21 09:03:40 (GMT) |
commit | 6921c13bbbb2c9695edd87331d98f7aa1e48f7f2 (patch) | |
tree | 61ae803a71c58b7306775afb8f73aef6e6ebe939 /Modules | |
parent | ac13ad6a32e5c130de91fc2038de9b1c265b3fe9 (diff) | |
download | cpython-6921c13bbbb2c9695edd87331d98f7aa1e48f7f2.zip cpython-6921c13bbbb2c9695edd87331d98f7aa1e48f7f2.tar.gz cpython-6921c13bbbb2c9695edd87331d98f7aa1e48f7f2.tar.bz2 |
Minor nit. Make the rotate() success/fail tests consistent.
Diffstat (limited to 'Modules')
-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 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); |