Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Remove unnecessary cloning in overwrite_with #8580

Merged
merged 2 commits into from
May 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ethcore/src/state/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ impl Account {
self.code_size = other.code_size;
self.address_hash = other.address_hash;
let mut cache = self.storage_cache.borrow_mut();
for (k, v) in other.storage_cache.into_inner() {
cache.insert(k.clone() , v.clone()); //TODO: cloning should not be required here
for (k, v) in other.storage_cache.into_inner().into_iter() {
Copy link
Contributor

@rphmeier rphmeier May 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't a call to into_iter() redundant? or is there some magic happening I don't understand?

cache.insert(k, v);
}
self.storage_changes = other.storage_changes;
}
Expand Down