5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-08 21:18:07 +03:00

cleanup rrd bounds checks in datastore status call

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-11-24 13:55:22 +01:00
parent 84283eabb0
commit 6d1f8b4b51

View File

@ -102,10 +102,10 @@ pub async fn datastore_status(
}
};
let total = if idx < avail.data.len() && avail.data[idx].is_some() {
avail.data[idx].unwrap() + used
} else if idx < total_entry.data.len() && total_entry.data[idx].is_some() {
total_entry.data[idx].unwrap()
let total = if let Some(avail) = avail.get(idx) {
avail + used
} else if let Some(total) = total_entry.get(idx) {
total
} else {
history.push(None);
continue;