tree-wide: replace for loop with FOREACH_ELEMENT or FOREACH_ARRAY macros (#34893)
This commit is contained in:
@@ -74,12 +74,12 @@ static const char *translate_runlevel(int runlevel, bool *isolate) {
|
||||
|
||||
assert(isolate);
|
||||
|
||||
for (size_t i = 0; i < ELEMENTSOF(table); i++)
|
||||
if (table[i].runlevel == runlevel) {
|
||||
*isolate = table[i].isolate;
|
||||
FOREACH_ELEMENT(i, table)
|
||||
if (i->runlevel == runlevel) {
|
||||
*isolate = i->isolate;
|
||||
if (runlevel == '6' && kexec_loaded())
|
||||
return SPECIAL_KEXEC_TARGET;
|
||||
return table[i].special;
|
||||
return i->special;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user