From 984e6b853d7bac3d5b43ccf10c96862623e93e96 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 24 Jan 2014 17:11:47 -0800 Subject: [PATCH] style: Stop copying attribute names when looking them up in the hash table. 40% improvement in selector matching performance on the rainbow page. --- src/components/style/selector_matching.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/style/selector_matching.rs b/src/components/style/selector_matching.rs index 5d19530fa00..6e0ae833a1f 100644 --- a/src/components/style/selector_matching.rs +++ b/src/components/style/selector_matching.rs @@ -120,7 +120,7 @@ impl SelectorMap { hash: &HashMap<~str,~[Rule]>, key: &str, matching_rules: &mut ~[Rule]) { - match hash.find(&key.to_str()) { + match hash.find_equiv(&key) { Some(rules) => { SelectorMap::get_matching_rules(node, *rules, matching_rules) }