mirror of
https://git.proxmox.com/git/proxmox
synced 2025-06-08 19:48:56 +00:00
proxmox-rrd: cleanup - use staturating_add instead of if/else
This commit is contained in:
parent
26bd6a4f77
commit
2b9fb32de1
@ -219,11 +219,7 @@ impl RRA {
|
|||||||
self.last_count = 0;
|
self.last_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
let new_count = if self.last_count < u64::MAX {
|
let new_count = self.last_count.saturating_add(1);
|
||||||
self.last_count + 1
|
|
||||||
} else {
|
|
||||||
u64::MAX // should never happen
|
|
||||||
};
|
|
||||||
|
|
||||||
if self.last_count == 0 {
|
if self.last_count == 0 {
|
||||||
self.data[index] = value;
|
self.data[index] = value;
|
||||||
|
Loading…
Reference in New Issue
Block a user