From 603d0a54ea565c1cc292a84836f44bcfa844a319 Mon Sep 17 00:00:00 2001 From: Iszak Bryan Date: Sun, 3 Jan 2016 00:13:52 +0000 Subject: [PATCH] Use atom's for matching to gain performance benefits --- components/script/dom/htmlinputelement.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 1a24d32f313..4b1f2b5703e 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -570,14 +570,14 @@ impl VirtualMethods for HTMLInputElement { &atom!("type") => { match mutation { AttributeMutation::Set(_) => { - let value = match &**attr.value() { - "button" => InputType::InputButton, - "submit" => InputType::InputSubmit, - "reset" => InputType::InputReset, - "file" => InputType::InputFile, - "radio" => InputType::InputRadio, - "checkbox" => InputType::InputCheckbox, - "password" => InputType::InputPassword, + let value = match attr.value().as_atom() { + &atom!("button") => InputType::InputButton, + &atom!("submit") => InputType::InputSubmit, + &atom!("reset") => InputType::InputReset, + &atom!("file") => InputType::InputFile, + &atom!("radio") => InputType::InputRadio, + &atom!("checkbox") => InputType::InputCheckbox, + &atom!("password") => InputType::InputPassword, _ => InputType::InputText, }; self.input_type.set(value);