style: Stop copying attribute names when looking them up in the hash

table.

40% improvement in selector matching performance on the rainbow page.
This commit is contained in:
Patrick Walton 2014-01-24 17:11:47 -08:00
parent 6ee9f8a982
commit 984e6b853d

View file

@ -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)
}