summaryrefslogtreecommitdiff
path: root/vm_args.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_args.c')
-rw-r--r--vm_args.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/vm_args.c b/vm_args.c
index a8b1130fd9..35c435181a 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -676,18 +676,16 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co
given_argc--;
}
}
- else if (given_argc > max_argc && max_argc >= 0) {
- if (args_pop_keyword_hash(args, &keyword_hash)) {
- /* Warn the following:
- * def foo(k:1) p [k]; end
- * foo({k:42}) #=> 42
- */
- if (ec->cfp->iseq) {
- /* called from Ruby level */
- rb_warn_last_hash_to_keyword(calling, ci);
- }
- given_argc--;
+ else if (args_pop_keyword_hash(args, &keyword_hash)) {
+ /* Warn the following:
+ * def foo(k:1) p [k]; end
+ * foo({k:42}) #=> 42
+ */
+ if (ec->cfp->iseq) {
+ /* called from Ruby level */
+ rb_warn_last_hash_to_keyword(calling, ci);
}
+ given_argc--;
}
}