Skip to content

Commit e354e9b

Browse files
committed
refactor: utilize a predefined macro
1 parent 7c402d2 commit e354e9b

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

iseq.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3711,11 +3711,7 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
37113711

37123712
if (is_proc) {
37133713
for (i = 0; i < body->param.lead_num; i++) {
3714-
PARAM_TYPE(opt);
3715-
if (PARAM_ID(i) != idItImplicit && rb_id2str(PARAM_ID(i))) {
3716-
rb_ary_push(a, ID2SYM(PARAM_ID(i)));
3717-
}
3718-
rb_ary_push(args, a);
3714+
rb_ary_push(args, PARAM(i, opt));
37193715
}
37203716
}
37213717
else {
@@ -3725,11 +3721,7 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
37253721
}
37263722
r = body->param.lead_num + body->param.opt_num;
37273723
for (; i < r; i++) {
3728-
PARAM_TYPE(opt);
3729-
if (rb_id2str(PARAM_ID(i))) {
3730-
rb_ary_push(a, ID2SYM(PARAM_ID(i)));
3731-
}
3732-
rb_ary_push(args, a);
3724+
rb_ary_push(args, PARAM(i, opt));
37333725
}
37343726
if (body->param.flags.has_rest) {
37353727
CONST_ID(rest, "rest");
@@ -3738,11 +3730,7 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
37383730
r = body->param.post_start + body->param.post_num;
37393731
if (is_proc) {
37403732
for (i = body->param.post_start; i < r; i++) {
3741-
PARAM_TYPE(opt);
3742-
if (rb_id2str(PARAM_ID(i))) {
3743-
rb_ary_push(a, ID2SYM(PARAM_ID(i)));
3744-
}
3745-
rb_ary_push(args, a);
3733+
rb_ary_push(args, PARAM(i, opt));
37463734
}
37473735
}
37483736
else {

0 commit comments

Comments
 (0)