Skip to content

Commit

Permalink
skip updating if output power did not change
Browse files Browse the repository at this point in the history
  • Loading branch information
BramOtte committed Dec 12, 2023
1 parent 7c59fd2 commit cd8e014
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/core/src/redpiler/backend/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ impl DirectBackend {
let old_power = old_power.saturating_sub(distance);
let new_power = new_power.saturating_sub(distance);

if old_power == new_power {
continue;
}

// Safety: signal strength is never larger than 15
unsafe {
*inputs.get_unchecked_mut(old_power as usize) -= 1;
Expand Down

0 comments on commit cd8e014

Please sign in to comment.