Skip to content

Apache DataFusion SQL Query Engine

Remove unnecessary shifts in gcd() (#12480)

Piotr Findeisena08f923c2acb
diff --git a/datafusion/functions/src/math/gcd.rs b/datafusion/functions/src/math/gcd.rs
index 95a559c5d1..10faf9f390 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();