Really address the issue of where to place the assert for leftblock.

(Followup of Klocwork 274)
This commit is contained in:
Neal Norwitz 2006-08-13 18:13:02 +00:00
parent 20745b1a70
commit ccc56c7c96
1 changed files with 1 additions and 1 deletions

View File

@ -211,6 +211,7 @@ deque_popleft(dequeobject *deque, PyObject *unused)
PyErr_SetString(PyExc_IndexError, "pop from an empty deque");
return NULL;
}
assert(deque->leftblock != NULL);
item = deque->leftblock->data[deque->leftindex];
deque->leftindex++;
deque->len--;
@ -224,7 +225,6 @@ deque_popleft(dequeobject *deque, PyObject *unused)
deque->leftindex = CENTER + 1;
deque->rightindex = CENTER;
} else {
assert(deque->leftblock != NULL);
assert(deque->leftblock != deque->rightblock);
prevblock = deque->leftblock->rightlink;
PyMem_Free(deque->leftblock);