Skip to content
Permalink
Browse files
Need not to call mrb_obj_as_string() is sep is nil.
  • Loading branch information
matz committed Mar 18, 2017
1 parent ce86975 commit 6db38c376880651b76263b16788c36c6c9ea3aef
Showing 1 changed file with 3 additions and 1 deletion.
@@ -1071,7 +1071,9 @@ join_ary(mrb_state *mrb, mrb_value ary, mrb_value sep, mrb_value list)
MRB_API mrb_value
mrb_ary_join(mrb_state *mrb, mrb_value ary, mrb_value sep)
{
sep = mrb_obj_as_string(mrb, sep);
if (!mrb_nil_p(sep)) {
sep = mrb_obj_as_string(mrb, sep);
}
return join_ary(mrb, ary, sep, mrb_ary_new(mrb));
}

0 comments on commit 6db38c3

Please sign in to comment.