From 073629076f9268f8c8a4aa1e1ad1ca656ba18e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 23 Jul 2018 19:16:13 +0200 Subject: [PATCH] script: Avoid useless string clones in mutation observer stuff. --- components/script/dom/mutationobserver.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/script/dom/mutationobserver.rs b/components/script/dom/mutationobserver.rs index d0dc201f12e..ff01ce96ba9 100644 --- a/components/script/dom/mutationobserver.rs +++ b/components/script/dom/mutationobserver.rs @@ -184,7 +184,7 @@ impl MutationObserver { } // Step 4 - for &(ref observer, ref paired_string) in &interested_observers { + for (observer, paired_string) in interested_observers { // Steps 4.1-4.7 let record = match attr_type { Mutation::Attribute { ref name, ref namespace, .. } => { @@ -193,10 +193,10 @@ impl MutationObserver { } else { None }; - MutationRecord::attribute_mutated(target, name, namespace, paired_string.clone()) + MutationRecord::attribute_mutated(target, name, namespace, paired_string) }, Mutation::CharacterData { .. } => { - MutationRecord::character_data_mutated(target, paired_string.clone()) + MutationRecord::character_data_mutated(target, paired_string) } Mutation::ChildList { ref added, ref removed, ref next, ref prev } => { MutationRecord::child_list_mutated(target, *added, *removed, *next, *prev)