optimization: Avoid bound checking twice in Cartridge::read_8

Former-commit-id: fb9db936f7d7a89b467c3c3dfd290c43b5324da6
This commit is contained in:
Michel Heily 2020-02-07 17:13:05 +02:00
parent 3a488e4487
commit 374c429d16

View file

@ -47,7 +47,7 @@ impl Bus for Cartridge {
if offset >= self.size { if offset >= self.size {
0xDD // TODO - open bus implementation 0xDD // TODO - open bus implementation
} else { } else {
self.bytes[offset as usize] unsafe { *self.bytes.get_unchecked(offset as usize) }
} }
} }
} }