Skip to content

Commit

Permalink
Remove unnecessary checks for empty kw splat
Browse files Browse the repository at this point in the history
These two checks are surrounded by an if that ensures the
call site is not a kw splat call site.
  • Loading branch information
XrXr authored Apr 23, 2021
1 parent 4b36a59 commit a224ce8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions vm_insnhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -2417,7 +2417,6 @@ vm_callee_setup_arg(rb_execution_context_t *ec, struct rb_calling_info *calling,
if (LIKELY(rb_simple_iseq_p(iseq))) {
rb_control_frame_t *cfp = ec->cfp;
CALLER_SETUP_ARG(cfp, calling, ci);
CALLER_REMOVE_EMPTY_KW_SPLAT(cfp, calling, ci);

if (calling->argc != iseq->body->param.lead_num) {
argument_arity_error(ec, iseq, calling->argc, iseq->body->param.lead_num, iseq->body->param.lead_num);
Expand All @@ -2431,7 +2430,6 @@ vm_callee_setup_arg(rb_execution_context_t *ec, struct rb_calling_info *calling,
else if (rb_iseq_only_optparam_p(iseq)) {
rb_control_frame_t *cfp = ec->cfp;
CALLER_SETUP_ARG(cfp, calling, ci);
CALLER_REMOVE_EMPTY_KW_SPLAT(cfp, calling, ci);

const int lead_num = iseq->body->param.lead_num;
const int opt_num = iseq->body->param.opt_num;
Expand Down

0 comments on commit a224ce8

Please sign in to comment.