tree-wide: replace for loop with FOREACH_ELEMENT or FOREACH_ARRAY macros (#34893)

This commit is contained in:
Integral
2024-10-26 07:10:22 +09:00
committed by GitHub
parent f7078de515
commit ddb8a639d5
46 changed files with 249 additions and 269 deletions
+3 -3
View File
@@ -71,13 +71,13 @@ int proc_cmdline_filter_pid1_args(char **argv, char ***ret) {
}
/* long option, e.g. --foo */
for (size_t i = 0; i < ELEMENTSOF(options); i++) {
const char *q = startswith(a + 2, options[i].name);
FOREACH_ELEMENT(option, options) {
const char *q = startswith(a + 2, option->name);
if (!q || !IN_SET(q[0], '=', '\0'))
continue;
/* Found matching option, updating the state if necessary. */
if (q[0] == '\0' && options[i].has_arg == required_argument)
if (q[0] == '\0' && option->has_arg == required_argument)
state = required_argument;
break;