diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-08-11 12:57:37 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-08-11 12:57:37 +0900 |
| commit | ef0b239704c2552f19f4e23d6c206884650a77ac (patch) | |
| tree | dacc7d22899cf699b759a2ce31d897ae6179a3fe /mrbgems/mruby-array-ext/src/array.c | |
| parent | 67e2dddb8254fbf4a4eb81c1241ec1963bc77627 (diff) | |
| download | mruby-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/src/array.c')
| -rw-r--r-- | mrbgems/mruby-array-ext/src/array.c | 11 |
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)) ); } |
