GSL + CPP core guidelines changes.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2017-11-18 14:29:30 +00:00
parent dea1847280
commit 67c27d4a3e
27 changed files with 162 additions and 150 deletions

View File

@@ -15,7 +15,7 @@ void EightBit::Processor::initialise() {
int EightBit::Processor::run(int limit) {
int current = 0;
while (powered() && current < limit) {
while (GSL_LIKELY(powered()) && current < limit) {
current += singleStep();
}
return current;
@@ -35,7 +35,7 @@ void EightBit::Processor::fetchWord(register16_t& output) {
}
int EightBit::Processor::fetchExecute() {
if (!powered())
return 0;
return execute(fetchByte());
if (GSL_LIKELY(powered()))
return execute(fetchByte());
return 0;
}