optimization: Avoid bound checking twice in Cartridge::read_8
Former-commit-id: fb9db936f7d7a89b467c3c3dfd290c43b5324da6
This commit is contained in:
parent
3a488e4487
commit
374c429d16
|
@ -47,7 +47,7 @@ impl Bus for Cartridge {
|
|||
if offset >= self.size {
|
||||
0xDD // TODO - open bus implementation
|
||||
} else {
|
||||
self.bytes[offset as usize]
|
||||
unsafe { *self.bytes.get_unchecked(offset as usize) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue