We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8aaaa12 commit 4e67132Copy full SHA for 4e67132
src/backend/kms/surface/timings.rs
@@ -51,7 +51,7 @@ impl Frame {
51
}
52
53
impl Timings {
54
- const WINDOW_SIZE: usize = 360;
+ const CLEANUP: usize = 360;
55
56
pub fn new(
57
refresh_interval: Option<Duration>,
@@ -171,8 +171,9 @@ impl Timings {
171
);
172
173
self.previous_frames.push_back(new_frame);
174
- while self.previous_frames.len() > Self::WINDOW_SIZE {
175
- self.previous_frames.pop_front();
+
+ if let Some(overflow) = self.previous_frames.len().checked_sub(Self::CLEANUP * 2) {
176
+ self.previous_frames = self.previous_frames.split_off(overflow + Self::CLEANUP);
177
178
179
0 commit comments