mirror of
https://github.com/servo/servo.git
synced 2025-08-13 17:35:36 +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
|
@ -309,14 +309,14 @@ pub enum StyleSharingResult {
|
|||
/// Note that this cache is flushed every time we steal work from the queue, so
|
||||
/// storing nodes here temporarily is safe.
|
||||
pub struct StyleSharingCandidateCache<E: TElement> {
|
||||
cache: LRUCache<StyleSharingCandidate<E>>,
|
||||
cache: LRUCache<[StyleSharingCandidate<E>; STYLE_SHARING_CANDIDATE_CACHE_SIZE + 1]>,
|
||||
}
|
||||
|
||||
impl<E: TElement> StyleSharingCandidateCache<E> {
|
||||
/// Create a new style sharing candidate cache.
|
||||
pub fn new() -> Self {
|
||||
StyleSharingCandidateCache {
|
||||
cache: LRUCache::new(STYLE_SHARING_CANDIDATE_CACHE_SIZE),
|
||||
cache: LRUCache::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue