diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2022-11-19 15:09:53 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-19 15:09:53 -0500 |
commit | b7ac83e926ceb3d26c636893703576f12d5fa0d6 (patch) | |
tree | c47ec1f7f55af4bb4341ce9b27b46de261c0e3ee /src | |
parent | f52b66a844d4bc790f62307b5c82e413c7b1e0c4 (diff) |
other: shrink the timed data vector in addition to clearing (#900)
Should prevent the times series vector from possibly growing indefinitely.
Diffstat (limited to 'src')
-rw-r--r-- | src/app/data_farmer.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/app/data_farmer.rs b/src/app/data_farmer.rs index efbc5799..e6a7266f 100644 --- a/src/app/data_farmer.rs +++ b/src/app/data_farmer.rs @@ -196,6 +196,7 @@ impl DataCollection { }; 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>) { |