Skip to content

Commit

Permalink
Prune empty caches
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Dec 3, 2024
1 parent 0273657 commit 6abd224
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/egui/src/cache/cache_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ impl CacheStorage {

/// Call once per frame to evict cache.
pub fn update(&mut self) {
for cache in self.caches.values_mut() {
self.caches.retain(|_, cache| {
cache.update();
}
cache.len() > 0
});
}
}

Expand Down

0 comments on commit 6abd224

Please sign in to comment.