Skip initializing optional arguments to nil

They are optional because they have a default value, so I don't
understand why we'd need to initialize them to nil.
This commit is contained in:
Jean Boussier 2025-12-31 14:52:16 +01:00
parent b9819ad06c
commit 1596853428
Notes: git 2026-01-02 15:59:29 +00:00

View File

@ -245,7 +245,6 @@ args_setup_opt_parameters(struct args_info *args, int opt_max, VALUE *locals)
i = opt_max;
}
else {
int j;
i = args->argc;
args->argc = 0;
@ -257,11 +256,6 @@ args_setup_opt_parameters(struct args_info *args, int opt_max, VALUE *locals)
locals[i] = argv[args->rest_index];
}
}
/* initialize by nil */
for (j=i; j<opt_max; j++) {
locals[j] = Qnil;
}
}
return i;