mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
refactor: utilize a predefined macro
This commit is contained in:
parent
7c402d2c27
commit
e354e9ba10
Notes:
git
2025-12-17 03:37:40 +00:00
18
iseq.c
18
iseq.c
@ -3711,11 +3711,7 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
|
||||
|
||||
if (is_proc) {
|
||||
for (i = 0; i < body->param.lead_num; i++) {
|
||||
PARAM_TYPE(opt);
|
||||
if (PARAM_ID(i) != idItImplicit && rb_id2str(PARAM_ID(i))) {
|
||||
rb_ary_push(a, ID2SYM(PARAM_ID(i)));
|
||||
}
|
||||
rb_ary_push(args, a);
|
||||
rb_ary_push(args, PARAM(i, opt));
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -3725,11 +3721,7 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
|
||||
}
|
||||
r = body->param.lead_num + body->param.opt_num;
|
||||
for (; i < r; i++) {
|
||||
PARAM_TYPE(opt);
|
||||
if (rb_id2str(PARAM_ID(i))) {
|
||||
rb_ary_push(a, ID2SYM(PARAM_ID(i)));
|
||||
}
|
||||
rb_ary_push(args, a);
|
||||
rb_ary_push(args, PARAM(i, opt));
|
||||
}
|
||||
if (body->param.flags.has_rest) {
|
||||
CONST_ID(rest, "rest");
|
||||
@ -3738,11 +3730,7 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
|
||||
r = body->param.post_start + body->param.post_num;
|
||||
if (is_proc) {
|
||||
for (i = body->param.post_start; i < r; i++) {
|
||||
PARAM_TYPE(opt);
|
||||
if (rb_id2str(PARAM_ID(i))) {
|
||||
rb_ary_push(a, ID2SYM(PARAM_ID(i)));
|
||||
}
|
||||
rb_ary_push(args, a);
|
||||
rb_ary_push(args, PARAM(i, opt));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user