summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2025-12-17 11:57:57 +0900
committerYusuke Endoh <mame@ruby-lang.org>2025-12-17 12:37:13 +0900
commite354e9ba1007c10df3ee843bb9daabd89b47a708 (patch)
tree970d24397c079bfe786b406a6ad6f6165860f762
parent7c402d2c2757b38df8b9406b372d2e1f406296ae (diff)
refactor: utilize a predefined macro
-rw-r--r--iseq.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/iseq.c b/iseq.c
index 90facfad78..7457118e07 100644
--- a/iseq.c
+++ b/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 {