mirror of
https://github.com/bradgrantham/apple2a.git
synced 2024-06-12 22:29:29 +00:00
Slightly improve performance of NEXT.
This commit is contained in:
parent
5569b9f58c
commit
8fa3789ade
|
@ -381,13 +381,16 @@ static ForInfo *find_for_info(uint16_t var_address) {
|
||||||
int i;
|
int i;
|
||||||
ForInfo *f;
|
ForInfo *f;
|
||||||
|
|
||||||
for (i = 0; i < g_for_count; i++) {
|
// Work backwards through the stack, since the variable we're looking
|
||||||
f = &g_for_info[i];
|
// for is likely to be the most recent one.
|
||||||
|
f = &g_for_info[g_for_count - 1];
|
||||||
|
for (i = g_for_count - 1; i >= 0; i--) {
|
||||||
if (f->var_address == var_address) {
|
if (f->var_address == var_address) {
|
||||||
// Found it.
|
// Found it.
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user