Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce allocations in SelectorMap (Rule Hash) code #1299

Merged
merged 5 commits into from Nov 22, 2013
Prev

Use push instead of referring to the last element.

  • Loading branch information
pradeep90 committed Nov 22, 2013
commit ae1f16887d863aee545d3ea6768c66590eaa3d43
@@ -303,11 +303,11 @@ impl Stylist {
// optimizations regarding grouping of Rules having the same Selector.
let mut declarations_list = ~[];
for rules in matching_rules_list.iter() {
declarations_list.push(~[]);
let curr_declarations = &mut declarations_list[declarations_list.len() - 1];
let mut curr_declarations = ~[];
for rule in rules.iter() {
curr_declarations.push(rule.declarations.clone());
}
declarations_list.push(curr_declarations);
}

let mut applicable_declarations = ~[];
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.