array.c: avoid slower mrb_get_args() if possible

This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-01-25 14:10:03 +09:00
parent 37da677cc8
commit 4e5be5a288
2 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -89,8 +89,7 @@ mrb_ary_rassoc(mrb_state *mrb, mrb_value ary)
static mrb_value
mrb_ary_at(mrb_state *mrb, mrb_value ary)
{
mrb_int pos;
mrb_get_args(mrb, "i", &pos);
mrb_int pos = mrb_as_int(mrb, mrb_get_arg1(mrb));
return mrb_ary_entry(ary, pos);
}