Skip to content

Commit

Permalink
opt the get_leaf impl
Browse files Browse the repository at this point in the history
  • Loading branch information
flyq committed May 15, 2024
1 parent e07b17b commit 9dfd633
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions verkle-trie/src/database/memory_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ impl ReadOnlyHigherDb for MemoryDb {
}

fn get_leaf(&self, key: [u8; 32]) -> Option<[u8; 32]> {
self.leaf_table
.get(&key)
.map(|val| val.to_vec().try_into().unwrap())
self.leaf_table.get(&key).map(|val| *val)

Check failure on line 60 in verkle-trie/src/database/memory_db.rs

View workflow job for this annotation

GitHub Actions / Lints

you are using an explicit closure for copying elements
}

fn get_branch_children(&self, branch_id: &[u8]) -> Vec<(u8, BranchChild)> {
Expand Down

0 comments on commit 9dfd633

Please sign in to comment.