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

View File

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