rrd: avoid intermediate index, directly loop over data

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-02-15 07:55:08 +01:00
parent c19af51ecb
commit ac20cb1f65
1 changed files with 2 additions and 2 deletions

View File

@ -177,8 +177,8 @@ impl RRA {
let mut index = self.slot(start); let mut index = self.slot(start);
for i in 0..data.len() { for item in data {
if let Some(v) = data[i] { if let Some(v) = item {
self.data[index] = v; self.data[index] = v;
} }
index += 1; if index >= self.data.len() { index = 0; } index += 1; if index >= self.data.len() { index = 0; }