]> git.ipfire.org Git - thirdparty/coreutils.git/commit
factor: faster gcd_odd since 2nd is odd
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Jul 2025 14:07:25 +0000 (07:07 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Jul 2025 00:12:40 +0000 (17:12 -0700)
commit37fbbc537375bce2d7e9f26ca47a84dffddfa56f
tree4a22a2ff2fd4dab949cc0b5196740aeb56378326
parent2ce3fc0c1b912aeed99f610cec392ba5d68dd5f5
factor: faster gcd_odd since 2nd is odd

* src/factor.c (gcd_odd, gcd2_odd): Speed up, given that the
second argument is always odd.
(gcd_odd): Avoid recomputing a temporary.
(gcd2_odd): Test for zero only if a multiple of B.
This saves an ‘assume’.
src/factor.c