]> git.ipfire.org Git - thirdparty/coreutils.git/commit
factor: use a more functional style
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 10 Jun 2025 00:28:34 +0000 (17:28 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Jul 2025 00:12:39 +0000 (17:12 -0700)
commit20beab12df15b276646655928629b518dc12243a
treee0db9d38b9747590d9f4a1532275bcd2163567e7
parentd16059e37506dc48c274f4bef32e56a70870da4c
factor: use a more functional style

This is mostly to make the code a bit easier to read.
It shrinks the size of factor.o by 0.7% on my x86-64 platform
though it doesn’t affect CPU performance significantly.
* src/factor.c (mp_no_factors): Rename from mp_factor_init.
(mp_no_factors, mp_factor_using_division, mp_factor):
Return struct mp_factors rather than modifying one passed by reference.
All uses changed.
src/factor.c