mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-07-19 02:25:24 +00:00
Optimisation: Prefer return by value to return by reference. ~10% speed-up!
Just watch a video by Chandler Carruth from 2015, where he talked about C++ optimisers... Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
@@ -20,10 +20,12 @@ uint8_t EightBit::IntelProcessor::pop() {
|
||||
return getByte(SP().word++);
|
||||
}
|
||||
|
||||
void EightBit::IntelProcessor::getWord(register16_t& value) {
|
||||
value.low = getByte(MEMPTR().word++);
|
||||
EightBit::register16_t EightBit::IntelProcessor::getWord() {
|
||||
register16_t returned;
|
||||
returned.low = getByte(MEMPTR().word++);
|
||||
BUS().ADDRESS().word++;
|
||||
value.high = getByte();
|
||||
returned.high = getByte();
|
||||
return returned;
|
||||
}
|
||||
|
||||
void EightBit::IntelProcessor::setWord(register16_t value) {
|
||||
|
Reference in New Issue
Block a user