Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Dec 3, 2024
1 parent e4aa1d1 commit 0273657
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/egui/src/cache/frame_publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<Key: Eq + Hash, Value> FramePublisher<Key, Value> {
}
}

/// Publish the value. It will be available for the duration of the and the next frame.
/// Publish the value. It will be available for the duration of this and the next frame.
pub fn set(&mut self, key: Key, value: Value) {
self.cache.insert(key, (self.generation, value));
}
Expand All @@ -36,7 +36,7 @@ impl<Key: Eq + Hash, Value> FramePublisher<Key, Value> {
pub fn evict_cache(&mut self) {
let current_generation = self.generation;
self.cache.retain(|_key, cached| {
cached.0 == current_generation // only keep those that were used this frame
cached.0 == current_generation // only keep those that were published this frame
});
self.generation = self.generation.wrapping_add(1);
}
Expand Down

0 comments on commit 0273657

Please sign in to comment.