From a991a12cbc63c803811673fa3b77c035fdf78558 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 2 Mar 2011 05:09:37 +0000 Subject: * string.c (rb_str_slice_bang): move treatments which is only needed when the result is not nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index 87273de5f1..bb13bd1d8d 100644 --- a/string.c +++ b/string.c @@ -3503,10 +3503,10 @@ rb_str_slice_bang(int argc, VALUE *argv, VALUE str) for (i=0; i "e" * "hello".byteslice(-1) #=> "o" * "hello".byteslice(1, 2) #=> "el" - * "\u3042".byteslice(1, 2) #=> "\x81\x82" - * "\u3042".byteslice(1..3) #=> "\x81\x82" + * "\x80\u3042".byteslice(1, 3) #=> "\u3042" + * "\x03\u3042\xff".byteslice(1..3) #=> "\u3942" */ static VALUE -- cgit v1.2.3