other: shrink the timed data vector in addition to clearing (#900)

Should prevent the times series vector from possibly growing indefinitely.
This commit is contained in:
Clement Tsang 2022-11-19 15:09:53 -05:00 committed by GitHub
parent f52b66a844
commit b7ac83e926
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -196,6 +196,7 @@ impl DataCollection {
}; };
self.timed_data_vec.drain(0..remove_index); self.timed_data_vec.drain(0..remove_index);
self.timed_data_vec.shrink_to_fit();
} }
pub fn eat_data(&mut self, harvested_data: Box<Data>) { pub fn eat_data(&mut self, harvested_data: Box<Data>) {