summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-array-ext
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-08-11 12:57:37 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-08-11 12:57:37 +0900
commitef0b239704c2552f19f4e23d6c206884650a77ac (patch)
treedacc7d22899cf699b759a2ce31d897ae6179a3fe /mrbgems/mruby-array-ext
parent67e2dddb8254fbf4a4eb81c1241ec1963bc77627 (diff)
downloadmruby-ef0b239704c2552f19f4e23d6c206884650a77ac.tar.gz
mruby-ef0b239704c2552f19f4e23d6c206884650a77ac.zip
Remove unnecessary inline function `ary_elt`.
And the function does not conform the naming convention anyway.
Diffstat (limited to 'mrbgems/mruby-array-ext')
-rw-r--r--mrbgems/mruby-array-ext/src/array.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mrbgems/mruby-array-ext/src/array.c b/mrbgems/mruby-array-ext/src/array.c
index 72e5080f1..e99599b09 100644
--- a/mrbgems/mruby-array-ext/src/array.c
+++ b/mrbgems/mruby-array-ext/src/array.c
@@ -127,19 +127,20 @@ mrb_ary_to_h(mrb_state *mrb, mrb_value ary)
hash = mrb_hash_new_capa(mrb, 0);
for (i = 0; i < RARRAY_LEN(ary); ++i) {
- v = mrb_check_array_type(mrb, RARRAY_PTR(ary)[i]);
+ mrb_value elt = RARRAY_PTR(ary)[i];
+ v = mrb_check_array_type(mrb, elt);
if (mrb_nil_p(v)) {
mrb_raisef(mrb, E_TYPE_ERROR, "wrong element type %S at %S (expected array)",
- mrb_str_new_cstr(mrb, mrb_obj_classname(mrb, ary_elt(ary, i))),
- mrb_fixnum_value(i)
+ mrb_str_new_cstr(mrb, mrb_obj_classname(mrb, elt)),
+ mrb_fixnum_value(i)
);
}
if (RARRAY_LEN(v) != 2) {
mrb_raisef(mrb, E_ARGUMENT_ERROR, "wrong array length at %S (expected 2, was %S)",
- mrb_fixnum_value(i),
- mrb_fixnum_value(RARRAY_LEN(v))
+ mrb_fixnum_value(i),
+ mrb_fixnum_value(RARRAY_LEN(v))
);
}