mirror of
https://github.com/servo/servo.git
synced 2025-08-23 14:25:33 +01:00
Adapt LRUCache to use ArrayDeque crate instead of VecDeque
This commit is contained in:
parent
7b61d55421
commit
8aeb512670
5 changed files with 31 additions and 20 deletions
|
@ -349,7 +349,7 @@ pub struct SelectorFlagsMap<E: TElement> {
|
|||
map: FnvHashMap<SendElement<E>, ElementSelectorFlags>,
|
||||
/// An LRU cache to avoid hashmap lookups, which can be slow if the map
|
||||
/// gets big.
|
||||
cache: LRUCache<(SendElement<E>, ElementSelectorFlags)>,
|
||||
cache: LRUCache<[(SendElement<E>, ElementSelectorFlags); 4 + 1]>,
|
||||
}
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
|
@ -364,7 +364,7 @@ impl<E: TElement> SelectorFlagsMap<E> {
|
|||
pub fn new() -> Self {
|
||||
SelectorFlagsMap {
|
||||
map: FnvHashMap::default(),
|
||||
cache: LRUCache::new(4),
|
||||
cache: LRUCache::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue