mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 04:07:58 +00:00
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:
parent
b9819ad06c
commit
1596853428
Notes:
git
2026-01-02 15:59:29 +00:00
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user