Skip to content

Commit

Permalink
Avoid call to_s during backtrace traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
craiglrock committed May 16, 2017
1 parent 82bc036 commit 3de2da4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ get_backtrace_i(mrb_state *mrb, struct backtrace_location *loc, void *data)
ary = mrb_obj_value((struct RArray*)data);

str = mrb_str_new_cstr(mrb, loc->filename);
str = mrb_format(mrb, "%S:%S", str, mrb_fixnum_value(loc->lineno));
str = mrb_format(mrb, "%S:%S", str, mrb_fixnum_to_str(mrb, mrb_fixnum_value(loc->lineno), 10));

if (loc->method) {
mrb_str_cat_lit(mrb, str, ":in ");
Expand Down

0 comments on commit 3de2da4

Please sign in to comment.