Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-lj committed Aug 22, 2024
1 parent d64b86c commit ca75907
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions fastcrypto/src/groups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,7 @@ pub trait Doubling: Clone {

/// Compute input * 2^repetitions by repeated doubling.
fn repeated_doubling(&self, repetitions: u64) -> Self {
if repetitions == 0 {
return self.clone();
}
let mut output = self.double();
for _ in 1..repetitions {
output = output.double();
}
output
(0..repetitions).fold(self.clone(), |acc, _| acc.double())
}
}

Expand Down

0 comments on commit ca75907

Please sign in to comment.