summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2025-12-31 14:52:16 +0100
committerJean Boussier <jean.boussier@gmail.com>2026-01-02 16:59:00 +0100
commit1596853428393136ee9964ad4c11b0120ed648d1 (patch)
tree613bdfcb06c5f664cbb8491a38c75d0a10023599
parentb9819ad06c883e6ea4f9e903c5bab06f175efb62 (diff)
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.
-rw-r--r--vm_args.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/vm_args.c b/vm_args.c
index 8d4042e355..458710e59e 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -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;