Skip to content

Commit

Permalink
Eliminate use of map by using a for loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
pradeep90 committed Nov 22, 2013
1 parent 7d90cc0 commit 92f4a43
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/style/selector_matching.rs
Expand Up @@ -304,8 +304,14 @@ impl Stylist {

// Keeping this as a separate step because we will need it for further
// optimizations regarding grouping of Rules having the same Selector.
let declarations_list = matching_rules_list.map(
|rules| rules.map(|r| r.declarations.clone()));
let mut declarations_list = ~[];
for rules in matching_rules_list.iter() {
declarations_list.push(~[]);
let curr_declarations = &mut declarations_list[declarations_list.len() - 1];
for rule in rules.iter() {
curr_declarations.push(rule.declarations.clone());
}
}

let mut applicable_declarations = ~[];
applicable_declarations.push_all_move(declarations_list.slice(0, 3).concat_vec());
Expand Down

0 comments on commit 92f4a43

Please sign in to comment.