Skip to content

Commit

Permalink
Remove excessive cloning in fragment checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mzabaluev committed Jul 29, 2021
1 parent e104d7b commit 71658bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wallet/src/scheme/freeutxo.rs
Expand Up @@ -77,7 +77,7 @@ impl Wallet {

fn check(&self, pk: &PublicKey<Ed25519>) -> Option<SecretKey<Ed25519Extended>> {
// FIXME: O(n)?
self.keys.iter().cloned().find(|k| &k.to_public() == pk)
self.keys.iter().find(|&k| &k.to_public() == pk).cloned()
}

pub fn check_fragment(&mut self, fragment_id: &FragmentId, fragment: &Fragment) -> bool {
Expand Down

0 comments on commit 71658bc

Please sign in to comment.