diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2014-01-08 15:08:27 +0000 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2014-01-08 15:58:52 +0000 |
commit | 724fd7caaf87048b6188c7bb252c5b18ddf11d8c (patch) | |
tree | 793b23d6f798bc801e0199b2aca5cbfbbbbd9bcf /src/components/style/selector_matching.rs | |
parent | faeab3773e7e716d65f1d5b877ae1a3fa1f2cc90 (diff) | |
download | servo-724fd7caaf87048b6188c7bb252c5b18ddf11d8c.tar.gz servo-724fd7caaf87048b6188c7bb252c5b18ddf11d8c.zip |
Store selectors in Arc early to avoid some copying.
Diffstat (limited to 'src/components/style/selector_matching.rs')
-rw-r--r-- | src/components/style/selector_matching.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/components/style/selector_matching.rs b/src/components/style/selector_matching.rs index 375e00e1b6b..3d48fd66a57 100644 --- a/src/components/style/selector_matching.rs +++ b/src/components/style/selector_matching.rs @@ -281,8 +281,7 @@ impl Stylist { Some(After) => &mut after_map, }; map.$priority.insert(Rule { - // TODO: avoid copying? - selector: Arc::new(selector.compound_selectors.clone()), + selector: selector.compound_selectors.clone(), specificity: selector.specificity, declarations: style_rule.declarations.$priority.clone(), source_order: self.rules_source_order, @@ -735,7 +734,7 @@ mod tests { .unwrap().move_iter().map(|s| { Rule { specificity: s.specificity, - selector: Arc::new(s.compound_selectors), + selector: s.compound_selectors, declarations: Arc::new(~[]), source_order: i, } |