diff --git a/agb/src/interrupt.rs b/agb/src/interrupt.rs index 60d15704..59bfa3c0 100644 --- a/agb/src/interrupt.rs +++ b/agb/src/interrupt.rs @@ -94,9 +94,8 @@ static mut INTERRUPT_TABLE: [InterruptRoot; 14] = [ #[no_mangle] pub extern "C" fn __RUST_INTERRUPT_HANDLER(interrupt: u16) { - for i in 0..=13_u16 { + for (i, root) in unsafe { INTERRUPT_TABLE.iter().enumerate() } { if (1 << i) & interrupt != 0 { - let root = unsafe { &INTERRUPT_TABLE[i as usize] }; root.trigger_interrupts(); } }