[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

Serhiy Storchaka report at bugs.python.org
Thu Feb 23 11:56:24 EST 2017


Serhiy Storchaka added the comment:

Wouldn't be better to update the number of repeats before the loop rather than checking at every iteration?

if (deque->maxlen >= 0 && n * size > deque->maxlen)
    n = (deque->maxlen + size - 1) / size;

----------
assignee:  -> rhettinger
nosy: +rhettinger, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29634>
_______________________________________


More information about the Python-bugs-list mailing list