]> git.ipfire.org Git - thirdparty/coreutils.git/commit
factor: refactor to for later performance speedup
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 8 Jun 2025 05:29:54 +0000 (22:29 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Jul 2025 00:12:39 +0000 (17:12 -0700)
commit748d03ca129baca82d300d35fb6eedc301a6d332
treee6918ac4d301a91cb34ca186c05b5474c0f62dd9
parent831623ba6683d8a8254b0ebcb1ee98191729a190
factor: refactor to for later performance speedup

This does not affect performance much, but it should allow future
performance improvements.
* src/factor.c (factor_using_division): Two new args I and P,
which generalize this function.  All uses changed.
(mp_finish_up_in_single, factor_up): New functions, like the
non-*_up* versions but with two new args PRIME_IDX and PRIME.
They mostly just have the old body of the old non-*_up_ versions.
(mp_finish_in_single, factor): Rewrite in terms of the new functions.
src/factor.c