diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-19 22:19:55 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-19 12:08:28 +0900 |
| commit | 698f5f707c2db334a15c605bf1b0d0cff42b1224 (patch) | |
| tree | 21b6e810ae42fe51c1531b273ac78e288a7d6fe0 /mrbgems/mruby-kernel-ext/src | |
| parent | 5bbcea9b3bdb0e7dc048f92cebefb54858196935 (diff) | |
| download | mruby-698f5f707c2db334a15c605bf1b0d0cff42b1224.tar.gz mruby-698f5f707c2db334a15c605bf1b0d0cff42b1224.zip | |
Removed `to_ary` conversion method.
Diffstat (limited to 'mrbgems/mruby-kernel-ext/src')
| -rw-r--r-- | mrbgems/mruby-kernel-ext/src/kernel.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/mrbgems/mruby-kernel-ext/src/kernel.c b/mrbgems/mruby-kernel-ext/src/kernel.c index bc2656399..324753f6e 100644 --- a/mrbgems/mruby-kernel-ext/src/kernel.c +++ b/mrbgems/mruby-kernel-ext/src/kernel.c @@ -161,9 +161,7 @@ mrb_f_string(mrb_state *mrb, mrb_value self) * call-seq: * Array(arg) -> array * - * Returns +arg+ as an Array. - * - * First tries to call Array#to_ary on +arg+, then Array#to_a. + * Returns +arg+ as an Array using to_a method. * * Array(1..5) #=> [1, 2, 3, 4, 5] * @@ -174,10 +172,7 @@ mrb_f_array(mrb_state *mrb, mrb_value self) mrb_value arg, tmp; mrb_get_args(mrb, "o", &arg); - tmp = mrb_check_convert_type(mrb, arg, MRB_TT_ARRAY, "Array", "to_ary"); - if (mrb_nil_p(tmp)) { - tmp = mrb_check_convert_type(mrb, arg, MRB_TT_ARRAY, "Array", "to_a"); - } + tmp = mrb_check_convert_type(mrb, arg, MRB_TT_ARRAY, "Array", "to_a"); if (mrb_nil_p(tmp)) { return mrb_ary_new_from_values(mrb, 1, &arg); } |
