Code relying on Integer::gcd and Integer::lcm for identitcal inputs could be sped up by eliminating unecessary recomputations of the gcd. A function computing and returning both could eliminate implicit gcd calls behind the scenes.
// Current situation
let a = 123.gcd(44); // gcd call #1
let b = 123.lcm(44); // gcd call #2, behind the scenes
// PR
// only 1 gcd call in total, which is reused for the lcm computation
let (a, b) = 123.gcd_lcm(44);
Code relying on
Integer::gcd
andInteger::lcm
for identitcal inputs could be sped up by eliminating unecessary recomputations of the gcd. A function computing and returning both could eliminate implicitgcd
calls behind the scenes.