Commit 36d3909e authored by cremno's avatar cremno

get classname and concatenate ": " only once

parent b4bb2a70
......@@ -149,14 +149,14 @@ exc_inspect(mrb_state *mrb, mrb_value exc)
}
}
else {
str = mrb_str_new_cstr(mrb, mrb_obj_classname(mrb, exc));
const char *cname = mrb_obj_classname(mrb, exc);
str = mrb_str_new_cstr(mrb, cname);
mrb_str_cat_lit(mrb, str, ": ");
if (append_mesg) {
mrb_str_cat_lit(mrb, str, ": ");
mrb_str_append(mrb, str, mesg);
}
else {
mrb_str_cat_lit(mrb, str, ": ");
mrb_str_cat_cstr(mrb, str, mrb_obj_classname(mrb, exc));
mrb_str_cat_cstr(mrb, str, cname);
}
}
return str;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment