Use mrb_str_new() instead of mrb_str_new2() as possible.

This commit is contained in:
Masaki Muranaka
2012-06-22 16:46:37 +09:00
parent 8946ad2c02
commit 21f2e5364b
6 changed files with 30 additions and 15 deletions
+2 -2
View File
@@ -887,7 +887,7 @@ inspect_ary(mrb_state *mrb, mrb_value ary, mrb_value list)
/* check recursive */
for(i=0; i<RARRAY_LEN(list); i++) {
if (mrb_obj_equal(mrb, ary, RARRAY_PTR(list)[i])) {
return mrb_str_new2(mrb, "[...]");
return mrb_str_new(mrb, "[...]", 5);
}
}
@@ -929,7 +929,7 @@ inspect_ary(mrb_state *mrb, mrb_value ary, mrb_value list)
static mrb_value
mrb_ary_inspect(mrb_state *mrb, mrb_value ary)
{
if (RARRAY_LEN(ary) == 0) return mrb_str_new2(mrb, "[]");
if (RARRAY_LEN(ary) == 0) return mrb_str_new(mrb, "[]", 2);
#if 0 /* THREAD */
return mrb_exec_recursive(inspect_ary_r, ary, 0);
#else