chore: make use of comptime control flow when working with tuples

This commit is contained in:
2022-10-31 03:22:08 -03:00
parent 2ef4bb7dcc
commit 472457b9f3
4 changed files with 19 additions and 43 deletions

View File

@@ -46,10 +46,7 @@ pub const Scheduler = struct {
},
.TimerOverflow => |id| {
switch (id) {
0 => cpu.bus.tim[0].onTimerExpire(cpu, late),
1 => cpu.bus.tim[1].onTimerExpire(cpu, late),
2 => cpu.bus.tim[2].onTimerExpire(cpu, late),
3 => cpu.bus.tim[3].onTimerExpire(cpu, late),
inline 0...3 => |idx| cpu.bus.tim[idx].onTimerExpire(cpu, late),
}
},
.ApuChannel => |id| {