From 74913ff05a9d7c8ba7d00eff31482a2bb1af9029 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 14 Nov 2013 12:13:24 +0900 Subject: [PATCH] Avoid one allocation in selector matching --- src/components/style/selector_matching.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/style/selector_matching.rs b/src/components/style/selector_matching.rs index 49d737b812d..a4fc7975de1 100644 --- a/src/components/style/selector_matching.rs +++ b/src/components/style/selector_matching.rs @@ -275,12 +275,12 @@ impl Stylist { "Style attributes do not apply to pseudo-elements"); // In cascading order - let rule_map_list = ~[&self.ua_rule_map.normal, - &self.user_rule_map.normal, - &self.author_rule_map.normal, - &self.author_rule_map.important, - &self.user_rule_map.important, - &self.ua_rule_map.important]; + let rule_map_list = [&self.ua_rule_map.normal, + &self.user_rule_map.normal, + &self.author_rule_map.normal, + &self.author_rule_map.important, + &self.user_rule_map.important, + &self.ua_rule_map.important]; // TODO: Make this a stack-allocated vector let mut matching_rules_list: [~[Rule], ..6] = [~[], ~[], ~[], ~[], ~[], ~[]];