]> git.proxmox.com Git - proxmox-backup.git/commitdiff
rrd: avoid intermediate index, directly loop over data
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 15 Feb 2022 06:55:08 +0000 (07:55 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 15 Feb 2022 06:59:55 +0000 (07:59 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxmox-rrd/src/rrd.rs

index 4b48d0cfecebc307bb2e4e1d445dee3b5a00fd5f..5fd7d0e2ed5d57cb6caac50d488c782fdb356078 100644 (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; }