summaryrefslogtreecommitdiff
path: root/vm_backtrace.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-09 04:27:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-09 04:27:39 +0000
commitb203f6734434bb100bb9e7874516d7fcae47f841 (patch)
tree414f2f5c3944feb2679533c2fa2543e7caba5fe0 /vm_backtrace.c
parent37fb998384bff100352baf9e0f84f58ab77a7fb7 (diff)
vm_backtrace.c: copy without creating prefix string
* vm_backtrace.c (rb_profile_frame_full_label): copy from label directly, without creating prefix string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r--vm_backtrace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c
index 74a9df2..4a0cc30 100644
--- a/vm_backtrace.c
+++ b/vm_backtrace.c
@@ -1357,8 +1357,8 @@ rb_profile_frame_full_label(VALUE frame)
else {
long label_length = RSTRING_LEN(label);
long base_label_length = RSTRING_LEN(base_label);
- VALUE prefix = rb_str_new(RSTRING_PTR(label), label_length - base_label_length);
+ int prefix_len = rb_long2int(label_length - base_label_length);
- return rb_sprintf("%"PRIsVALUE"%"PRIsVALUE, prefix, qualified_method_name);
+ return rb_sprintf("%.*s%"PRIsVALUE, prefix_len, RSTRING_PTR(label), qualified_method_name);
}
}