mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-kernel-ext: combine variable declaration with initialization
This commit is contained in:
@@ -231,9 +231,7 @@ static mrb_value
|
||||
mrb_f_string(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
mrb_value arg = mrb_get_arg1(mrb);
|
||||
mrb_value tmp;
|
||||
|
||||
tmp = mrb_type_convert(mrb, arg, MRB_TT_STRING, MRB_SYM(to_s));
|
||||
mrb_value tmp = mrb_type_convert(mrb, arg, MRB_TT_STRING, MRB_SYM(to_s));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
@@ -250,9 +248,7 @@ static mrb_value
|
||||
mrb_f_array(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
mrb_value arg = mrb_get_arg1(mrb);
|
||||
mrb_value tmp;
|
||||
|
||||
tmp = mrb_type_convert_check(mrb, arg, MRB_TT_ARRAY, MRB_SYM(to_a));
|
||||
mrb_value tmp = mrb_type_convert_check(mrb, arg, MRB_TT_ARRAY, MRB_SYM(to_a));
|
||||
if (mrb_nil_p(tmp)) {
|
||||
return mrb_ary_new_from_values(mrb, 1, &arg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user