From a08f923c2acb1a46614970231d9a672c36ce3ad2 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Mon, 16 Sep 2024 21:04:51 +0200 Subject: [PATCH] Remove unnecessary shifts in gcd() (#12480) The `a` and `b` are shifted as a next instruction. --- datafusion/functions/src/math/gcd.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/datafusion/functions/src/math/gcd.rs b/datafusion/functions/src/math/gcd.rs index 95a559c5d103..10faf9f390bb 100644 --- a/datafusion/functions/src/math/gcd.rs +++ b/datafusion/functions/src/math/gcd.rs @@ -102,8 +102,6 @@ pub(super) fn unsigned_gcd(mut a: u64, mut b: u64) -> u64 { } let shift = (a | b).trailing_zeros(); - a >>= shift; - b >>= shift; a >>= a.trailing_zeros(); loop { b >>= b.trailing_zeros();