diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-09 04:27:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-09 04:27:39 +0000 |
commit | b203f6734434bb100bb9e7874516d7fcae47f841 (patch) | |
tree | 414f2f5c3944feb2679533c2fa2543e7caba5fe0 | |
parent | 37fb998384bff100352baf9e0f84f58ab77a7fb7 (diff) | |
download | ruby-b203f6734434bb100bb9e7874516d7fcae47f841.tar.gz |
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
-rw-r--r-- | vm_backtrace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c index 74a9df2ed0..4a0cc304b2 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); } } |