]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42161: mathmodule.c: move _PyLong_GetOne() loop invariant (GH-26391) (GH-26393)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 26 May 2021 23:13:17 +0000 (16:13 -0700)
committerGitHub <noreply@github.com>
Wed, 26 May 2021 23:13:17 +0000 (01:13 +0200)
commit4115996342278de7c2a1b59ac348322e7a4e9072
treed71f07b149ccef8244cdb10b5e15ef1d4a62d411
parent150a8e8a3edbbed12b98c8f22e2972cd47fd3ba5
bpo-42161: mathmodule.c: move _PyLong_GetOne() loop invariant (GH-26391) (GH-26393)

Move _PyLong_GetZero() and _PyLong_GetOne() loop invariants outside
loops in functions:

* math.comb()
* math.gcd()
* math.lcm()
* math.perm()
(cherry picked from commit 3e7ee02327db13e4337374597cdc4458ecb9e3ad)

Co-authored-by: Victor Stinner <vstinner@python.org>
Modules/mathmodule.c