Skip to content

Commit

Permalink
Remove unnecessary shifts in gcd() (#12480)
Browse files Browse the repository at this point in the history
The `a` and `b` are shifted as a next instruction.
  • Loading branch information
findepi authored Sep 16, 2024
1 parent 4282c45 commit a08f923
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions datafusion/functions/src/math/gcd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a08f923

Please sign in to comment.