summaryrefslogtreecommitdiff
path: root/src/layout/incremental.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-08-09 11:06:37 +0200
committerLaurenz <laurmaedje@gmail.com>2021-08-09 11:26:41 +0200
commit3932bb2cb93be95d67fc56998423eb9ce047fdfa (patch)
treec36bd4df1d2c74f8ae100d2f3bd3a0b232b797f5 /src/layout/incremental.rs
parent3c92bad9a7cd6b880de197806443ffcce2cac9d8 (diff)
New source loading architecture
Diffstat (limited to 'src/layout/incremental.rs')
-rw-r--r--src/layout/incremental.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/layout/incremental.rs b/src/layout/incremental.rs
index 32353d6f..baf2991a 100644
--- a/src/layout/incremental.rs
+++ b/src/layout/incremental.rs
@@ -1,5 +1,5 @@
#[cfg(feature = "layout-cache")]
-use std::collections::{hash_map::Entry, HashMap};
+use std::collections::HashMap;
use std::ops::Deref;
use super::*;
@@ -68,13 +68,10 @@ impl LayoutCache {
frames: Vec<Constrained<Rc<Frame>>>,
level: usize,
) {
- let entry = FramesEntry::new(frames, level);
- match self.frames.entry(hash) {
- Entry::Occupied(occupied) => occupied.into_mut().push(entry),
- Entry::Vacant(vacant) => {
- vacant.insert(vec![entry]);
- }
- }
+ self.frames
+ .entry(hash)
+ .or_default()
+ .push(FramesEntry::new(frames, level));
}
/// Clear the cache.