Skip to content

Commit

Permalink
devices: do not format error message for every device write
Browse files Browse the repository at this point in the history
This is showing in the flamegraph at almost 2%(!) of total run time.
  • Loading branch information
anisse committed Jul 16, 2024
1 parent f895749 commit 1539a0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/devices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl Devices {
addr & !map.ignore_mask >= map.start && addr & !map.ignore_mask <= map.end
})
.map(|(dev, _)| dev)
.ok_or(format!("Address {:04X} to unknown device", addr))
.ok_or_else(|| format!("Address {:04X} to unknown device", addr))
}
}

Expand Down

0 comments on commit 1539a0c

Please sign in to comment.