Skip to content

Commit

Permalink
clone -> as_ref
Browse files Browse the repository at this point in the history
  • Loading branch information
fgimenez committed Jan 20, 2025
1 parent ab03912 commit c01759f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/trie/trie/src/hashed_cursor/post_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ where
/// Create new instance of [`HashedPostStateStorageCursor`] for the given hashed address.
pub fn new(cursor: C, post_state_storage: Option<Arc<HashedStorageSorted>>) -> Self {
let post_state_cursor = post_state_storage
.clone()
.as_ref()
.map(|s| ForwardInMemoryCursor::new(Arc::new(s.non_zero_valued_slots.clone())));
let cleared_slots = post_state_storage.as_ref().map(|s| s.zero_valued_slots.clone());
let storage_wiped = post_state_storage.is_some_and(|s| s.wiped);
Expand All @@ -214,7 +214,7 @@ where
/// Check if the slot was zeroed out in the post state.
/// The database is not checked since it already has no zero-valued slots.
fn is_slot_zero_valued(&self, slot: &B256) -> bool {
self.cleared_slots.clone().is_some_and(|s| s.contains(slot))
self.cleared_slots.as_ref().is_some_and(|s| s.contains(slot))
}

/// Find the storage entry in post state or database that's greater or equal to provided subkey.
Expand Down

0 comments on commit c01759f

Please sign in to comment.