Convert one more division to unsigned arithmetic to speed-up deque_item().

This commit is contained in:
Raymond Hettinger 2015-02-28 07:41:30 -08:00
parent 6ab0ec9352
commit 63d1ff2a0b
1 changed files with 3 additions and 1 deletions

View File

@ -788,7 +788,9 @@ deque_item(dequeobject *deque, Py_ssize_t i)
while (n--)
b = b->rightlink;
} else {
n = (deque->leftindex + Py_SIZE(deque) - 1) / BLOCKLEN - n;
n = (Py_ssize_t)(
((unsigned)(deque->leftindex + Py_SIZE(deque) - 1))
/ BLOCKLEN - n);
b = deque->rightblock;
while (n--)
b = b->leftlink;