mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
nak: use saturating_sub() instead of open-coding it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
This commit is contained in:
parent
f4c832ac15
commit
340c355714
1 changed files with 1 additions and 1 deletions
|
|
@ -801,7 +801,7 @@ impl BlockDelayScheduler<'_> {
|
||||||
// current block is complete, so it is effectively executed at cycle
|
// current block is complete, so it is effectively executed at cycle
|
||||||
// `0 - delay`, adding the latency we get `latency - delay`
|
// `0 - delay`, adding the latency we get `latency - delay`
|
||||||
// Underflow means that the instruction is already done (delay > latency).
|
// Underflow means that the instruction is already done (delay > latency).
|
||||||
latency.checked_sub(delay.into()).unwrap_or(0)
|
latency.saturating_sub(delay.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue