mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #4760 from shuujii/use-mrb_str_concat-instead-of-mrb_str_to_str-plus-mrb_str_cat_str
Use `mrb_str_concat` instead of `mrb_str_to_str` + `mrb_str_cat_str`
This commit is contained in:
@@ -297,16 +297,16 @@ method_to_s(mrb_state *mrb, mrb_value self)
|
||||
mrb_str_cat_lit(mrb, str, ": ");
|
||||
rklass = mrb_class_ptr(klass);
|
||||
if (mrb_class_ptr(owner) == rklass) {
|
||||
mrb_str_cat_str(mrb, str, mrb_str_to_str(mrb, owner));
|
||||
mrb_str_concat(mrb, str, owner);
|
||||
mrb_str_cat_lit(mrb, str, "#");
|
||||
mrb_str_cat_str(mrb, str, mrb_str_to_str(mrb, name));
|
||||
mrb_str_concat(mrb, str, name);
|
||||
}
|
||||
else {
|
||||
mrb_str_cat_cstr(mrb, str, mrb_class_name(mrb, rklass));
|
||||
mrb_str_cat_lit(mrb, str, "(");
|
||||
mrb_str_cat_str(mrb, str, mrb_str_to_str(mrb, owner));
|
||||
mrb_str_concat(mrb, str, owner);
|
||||
mrb_str_cat_lit(mrb, str, ")#");
|
||||
mrb_str_cat_str(mrb, str, mrb_str_to_str(mrb, name));
|
||||
mrb_str_concat(mrb, str, name);
|
||||
}
|
||||
mrb_str_cat_lit(mrb, str, ">");
|
||||
return str;
|
||||
|
||||
Reference in New Issue
Block a user