mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Preallocate ring buffer result size
This commit is contained in:
@@ -59,7 +59,7 @@ impl ThroughputRingbuffer {
|
||||
}
|
||||
|
||||
pub fn get_result(&self) -> Vec<ThroughputPerSecond> {
|
||||
let mut result = Vec::new();
|
||||
let mut result = Vec::with_capacity(RINGBUFFER_SAMPLES);
|
||||
|
||||
for i in self.next..RINGBUFFER_SAMPLES {
|
||||
result.push(self.readings[i]);
|
||||
|
||||
Reference in New Issue
Block a user