Use `mrb_str_cat_str` instead of `mrb_str_concat` if possible
MODIFY
mrbgems/mruby-string-ext/src/string.c
mrbgems/mruby-string-ext/src/string.c
@@ -174,8 +174,8 @@ mrb_str_concat_m(mrb_state *mrb, mrb_value self)
str = int_chr_binary(mrb, str);
#endif
else
- str = mrb_ensure_string_type(mrb, str);
- mrb_str_concat(mrb, self, str);
+ mrb_ensure_string_type(mrb, str);
+ mrb_str_cat_str(mrb, self, str);
return self;
}

MODIFY
src/class.c
src/class.c
@@ -145,7 +145,7 @@ class_name_str(mrb_state *mrb, struct RClass* c)
if (mrb_nil_p(path)) {
path = c->tt == MRB_TT_MODULE ? mrb_str_new_lit(mrb, "#<Module:") :
mrb_str_new_lit(mrb, "#<Class:");
- mrb_str_concat(mrb, path, mrb_ptr_to_str(mrb, c));
+ mrb_str_cat_str(mrb, path, mrb_ptr_to_str(mrb, c));
mrb_str_cat_lit(mrb, path, ">");
}
return path;

MODIFY
src/object.c
src/object.c
@@ -423,7 +423,7 @@ mrb_any_to_s(mrb_state *mrb, mrb_value obj)
mrb_str_cat_cstr(mrb, str, cname);
if (!mrb_immediate_p(obj)) {
mrb_str_cat_lit(mrb, str, ":");
- mrb_str_concat(mrb, str, mrb_ptr_to_str(mrb, mrb_ptr(obj)));
+ mrb_str_cat_str(mrb, str, mrb_ptr_to_str(mrb, mrb_ptr(obj)));
}
mrb_str_cat_lit(mrb, str, ">");

MODIFY
src/variable.c
src/variable.c
@@ -509,7 +509,7 @@ mrb_obj_iv_inspect(mrb_state *mrb, struct RObject *obj)
mrb_str_cat_lit(mrb, str, "-<");
mrb_str_cat_cstr(mrb, str, cn);
mrb_str_cat_lit(mrb, str, ":");
- mrb_str_concat(mrb, str, mrb_ptr_to_str(mrb, obj));
+ mrb_str_cat_str(mrb, str, mrb_ptr_to_str(mrb, obj));
iv_foreach(mrb, t, inspect_i, &str);
mrb_str_cat_lit(mrb, str, ">");

Use `mrb_str_cat_str` instead of `mrb_str_concat` if possible