[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

STINNER Victor report at bugs.python.org
Tue Oct 27 16:32:54 EDT 2020


STINNER Victor <vstinner at python.org> added the comment:

> Why did you put _PyLong_GetOne() inside the loop for the fast path and outside the loop for the slow path?

Oh, I didn't notice that the first part was also a loop. I wrote PR 23008 to move the call out of the loop.

I tried to avoid calling the function if it's possible that the variable it not used. But here, it's always used, so it's relevant to move the loop invariant out of the loop ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42161>
_______________________________________


More information about the Python-bugs-list mailing list