style: Iterate the LRU cache contents from back to front.

We put the more recently used item last, so iterating then from left to right is
pointless.
This commit is contained in:
Emilio Cobos Álvarez 2017-03-09 15:39:17 +01:00
parent 2f8cf6afc3
commit d3e7f1f0f4
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 15 additions and 9 deletions

View file

@ -10,7 +10,7 @@
use {Atom, LocalName};
use animation::{self, Animation, PropertyAnimation};
use atomic_refcell::AtomicRefMut;
use cache::LRUCache;
use cache::{LRUCache, LRUCacheMutIterator};
use cascade_info::CascadeInfo;
use context::{SequentialTask, SharedStyleContext, StyleContext};
use data::{ComputedStyle, ElementData, ElementStyles, RestyleData};
@ -27,7 +27,6 @@ use selectors::matching::AFFECTED_BY_PSEUDO_ELEMENTS;
use servo_config::opts;
use sink::ForgetfulSink;
use std::collections::hash_map::Entry;
use std::slice::IterMut;
use std::sync::Arc;
use stylist::ApplicableDeclarationBlock;
@ -366,7 +365,7 @@ impl<E: TElement> StyleSharingCandidateCache<E> {
}
}
fn iter_mut(&mut self) -> IterMut<StyleSharingCandidate<E>> {
fn iter_mut(&mut self) -> LRUCacheMutIterator<StyleSharingCandidate<E>> {
self.cache.iter_mut()
}