mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Unreverse declarations in memory.
This commit is contained in:
parent
31864954ed
commit
477cae67df
4 changed files with 29 additions and 25 deletions
|
@ -788,7 +788,7 @@ impl Element {
|
|||
// than that.
|
||||
let existing_declarations = Arc::make_mut(existing_declarations);
|
||||
|
||||
while let Some(mut incoming_declaration) = declarations.pop() {
|
||||
for mut incoming_declaration in declarations {
|
||||
let mut replaced = false;
|
||||
for existing_declaration in &mut *existing_declarations {
|
||||
if existing_declaration.name() == incoming_declaration.name() {
|
||||
|
@ -799,8 +799,7 @@ impl Element {
|
|||
}
|
||||
|
||||
if !replaced {
|
||||
// inserting instead of pushing since the declarations are in reverse order
|
||||
existing_declarations.insert(0, incoming_declaration);
|
||||
existing_declarations.push(incoming_declaration);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue