From 382f06f1f85173aed9351199bc44837d613fb66d Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Wed, 9 May 2018 18:18:32 +0800 Subject: [PATCH 1/2] Remove unnecessary cloning in overwrite_with --- ethcore/src/state/account.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethcore/src/state/account.rs b/ethcore/src/state/account.rs index ff7d70bd3aa..702f19b1166 100644 --- a/ethcore/src/state/account.rs +++ b/ethcore/src/state/account.rs @@ -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() { + cache.insert(k, v); } self.storage_changes = other.storage_changes; } From 3c07dfecb7d78d4e88a2926946886457c32eb80d Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Wed, 9 May 2018 21:56:54 +0800 Subject: [PATCH 2/2] Remove into_iter --- ethcore/src/state/account.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/src/state/account.rs b/ethcore/src/state/account.rs index 702f19b1166..5c1dd403969 100644 --- a/ethcore/src/state/account.rs +++ b/ethcore/src/state/account.rs @@ -459,7 +459,7 @@ 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().into_iter() { + for (k, v) in other.storage_cache.into_inner() { cache.insert(k, v); } self.storage_changes = other.storage_changes;