mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
use mrb_str_cat_str() instead of mrb_str_append()
If the argument is always a string, then mrb_str_cat_str() can be directly called instead of indirectly by mrb_str_append(). mrb_any_to_s(), mrb_obj_as_string(), mrb_inspect() always return a string.
This commit is contained in:
+1
-1
@@ -609,7 +609,7 @@ inspect_i(mrb_state *mrb, mrb_sym sym, mrb_value v, void *p)
|
||||
else {
|
||||
ins = mrb_inspect(mrb, v);
|
||||
}
|
||||
mrb_str_append(mrb, str, ins);
|
||||
mrb_str_cat_str(mrb, str, ins);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user