Commit cee3dc58 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2612 from suzukaze/refactor-mrb_f_array

Refactor mrb_f_array func
parents 4fd28def 9b1d9a79
#include "mruby.h" #include "mruby.h"
#include "mruby/error.h" #include "mruby/error.h"
#include "mruby/object.h"
#include "mruby/array.h" #include "mruby/array.h"
/* /*
...@@ -45,7 +44,7 @@ mrb_f_array(mrb_state *mrb, mrb_value self) ...@@ -45,7 +44,7 @@ mrb_f_array(mrb_state *mrb, mrb_value self)
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)) { if (mrb_nil_p(tmp)) {
tmp = mrb_ary_new_from_values(mrb, 1, &arg); return mrb_ary_new_from_values(mrb, 1, &arg);
} }
return tmp; return tmp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment