mirror of https://github.com/python/cpython
Convert one more division to unsigned arithmetic to speed-up deque_item().
This commit is contained in:
parent
6ab0ec9352
commit
63d1ff2a0b
|
@ -788,7 +788,9 @@ deque_item(dequeobject *deque, Py_ssize_t i)
|
||||||
while (n--)
|
while (n--)
|
||||||
b = b->rightlink;
|
b = b->rightlink;
|
||||||
} else {
|
} 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;
|
b = deque->rightblock;
|
||||||
while (n--)
|
while (n--)
|
||||||
b = b->leftlink;
|
b = b->leftlink;
|
||||||
|
|
Loading…
Reference in New Issue