script: Avoid useless string clones in mutation observer stuff.

This commit is contained in:
Emilio Cobos Álvarez 2018-07-23 19:16:13 +02:00
parent e4f978e215
commit 073629076f
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -184,7 +184,7 @@ impl MutationObserver {
} }
// Step 4 // Step 4
for &(ref observer, ref paired_string) in &interested_observers { for (observer, paired_string) in interested_observers {
// Steps 4.1-4.7 // Steps 4.1-4.7
let record = match attr_type { let record = match attr_type {
Mutation::Attribute { ref name, ref namespace, .. } => { Mutation::Attribute { ref name, ref namespace, .. } => {
@ -193,10 +193,10 @@ impl MutationObserver {
} else { } else {
None None
}; };
MutationRecord::attribute_mutated(target, name, namespace, paired_string.clone()) MutationRecord::attribute_mutated(target, name, namespace, paired_string)
}, },
Mutation::CharacterData { .. } => { 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 } => { Mutation::ChildList { ref added, ref removed, ref next, ref prev } => {
MutationRecord::child_list_mutated(target, *added, *removed, *next, *prev) MutationRecord::child_list_mutated(target, *added, *removed, *next, *prev)