fix translate_events bug (#1354)

This commit is contained in:
Logan McNaughton authored and GitHub committed 2026-11-06 08:15:12 +00:00
1 parent 27d21f2535
commit cebfadef36
1 file changed
+1 -1
+1 -1
View File
@@ -95,7 +95,7 @@ fn set_next_event(device: &mut device::Device) {
pub fn translate_events(device: &mut device::Device, old_count: u64, new_count: u64) {
for i in device.cpu.events.iter_mut() {
if i.enabled {
i.count = i.count.wrapping_sub(old_count).wrapping_add(new_count);
i.count = new_count + i.count.saturating_sub(old_count);
}
}
set_next_event(device);