Minor nit. Make the rotate() success/fail tests consistent.

This commit is contained in:
Raymond Hettinger 2015-03-21 02:03:40 -07:00
parent ac13ad6a32
commit 6921c13bbb
1 changed files with 3 additions and 3 deletions

View File

@ -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);