mirror of
https://github.com/simh/simh.git
synced 2026-05-05 07:23:34 +00:00
Excape from doubly nested loop quickly for efficiency
This commit is contained in:
@@ -571,9 +571,13 @@ if (name) { /* updating? */
|
|||||||
return SCPE_ARG;
|
return SCPE_ARG;
|
||||||
for (autp = auto_tab; autp->numc >= 0; autp++) {
|
for (autp = auto_tab; autp->numc >= 0; autp++) {
|
||||||
for (j = 0; (j < AUTO_MAXC) && autp->dnam[j]; j++) {
|
for (j = 0; (j < AUTO_MAXC) && autp->dnam[j]; j++) {
|
||||||
if (strcmp (name, autp->dnam[j]) == 0)
|
if (strcmp (name, autp->dnam[j]) == 0) {
|
||||||
autp->numc = nctrl;
|
autp->numc = nctrl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if ((j < AUTO_MAXC) && autp->dnam[j] && (strcmp (name, autp->dnam[j]) == 0))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (autp = auto_tab; autp->numc >= 0; autp++) { /* loop thru table */
|
for (autp = auto_tab; autp->numc >= 0; autp++) { /* loop thru table */
|
||||||
|
|||||||
Reference in New Issue
Block a user