mirror of https://github.com/mgba-emu/mgba.git
Core: Remove unnecessary pointer operation in timing
This commit is contained in:
parent
2a0c53441a
commit
2c2a7ca436
|
@ -55,9 +55,10 @@ void mTimingDeschedule(struct mTiming* timing, struct mTimingEvent* event) {
|
||||||
|
|
||||||
void mTimingTick(struct mTiming* timing, int32_t cycles) {
|
void mTimingTick(struct mTiming* timing, int32_t cycles) {
|
||||||
timing->masterCycles += cycles;
|
timing->masterCycles += cycles;
|
||||||
|
uint32_t masterCycles = timing->masterCycles;
|
||||||
while (mTimingEventListSize(&timing->events)) {
|
while (mTimingEventListSize(&timing->events)) {
|
||||||
struct mTimingEvent* next = *mTimingEventListGetPointer(&timing->events, 0);
|
struct mTimingEvent* next = *mTimingEventListGetPointer(&timing->events, 0);
|
||||||
int32_t nextWhen = next->when - timing->masterCycles;
|
int32_t nextWhen = next->when - masterCycles;
|
||||||
if (nextWhen > 0) {
|
if (nextWhen > 0) {
|
||||||
*timing->nextEvent = nextWhen;
|
*timing->nextEvent = nextWhen;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue