Use push instead of referring to the last element.

This commit is contained in:
S Pradeep Kumar 2013-11-22 17:24:32 +09:00
parent cae74b4f86
commit ae1f16887d

View file

@ -303,11 +303,11 @@ impl Stylist {
// optimizations regarding grouping of Rules having the same Selector. // optimizations regarding grouping of Rules having the same Selector.
let mut declarations_list = ~[]; let mut declarations_list = ~[];
for rules in matching_rules_list.iter() { for rules in matching_rules_list.iter() {
declarations_list.push(~[]); let mut curr_declarations = ~[];
let curr_declarations = &mut declarations_list[declarations_list.len() - 1];
for rule in rules.iter() { for rule in rules.iter() {
curr_declarations.push(rule.declarations.clone()); curr_declarations.push(rule.declarations.clone());
} }
declarations_list.push(curr_declarations);
} }
let mut applicable_declarations = ~[]; let mut applicable_declarations = ~[];