diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-06-22 22:12:12 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-06-25 06:57:41 +0900 |
| commit | 03c2b8656b91a3975e1dbc7dc09ee12245e91c0c (patch) | |
| tree | ddfcf6c4770d78040bb358136ca7bc66e50ee11a /mrbgems/mruby-array-ext | |
| parent | ea6e1b003c7458a493ebad2ddb04bee1572f88be (diff) | |
| download | mruby-03c2b8656b91a3975e1dbc7dc09ee12245e91c0c.tar.gz mruby-03c2b8656b91a3975e1dbc7dc09ee12245e91c0c.zip | |
Use `mrb_get_argc()` to improve performance.
Diffstat (limited to 'mrbgems/mruby-array-ext')
| -rw-r--r-- | mrbgems/mruby-array-ext/src/array.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mrbgems/mruby-array-ext/src/array.c b/mrbgems/mruby-array-ext/src/array.c index 0cb61b2ab..3ce5d822e 100644 --- a/mrbgems/mruby-array-ext/src/array.c +++ b/mrbgems/mruby-array-ext/src/array.c @@ -138,9 +138,8 @@ mrb_ary_slice_bang(mrb_state *mrb, mrb_value self) mrb_ary_modify(mrb, a); if (mrb_get_argc(mrb) == 1) { - mrb_value index; + mrb_value index = mrb_get_arg1(mrb); - mrb_get_args(mrb, "o|i", &index, &len); switch (mrb_type(index)) { case MRB_TT_RANGE: if (mrb_range_beg_len(mrb, index, &i, &len, ARY_LEN(a), TRUE) == MRB_RANGE_OK) { |
