ruby-changes:39290
From: nobu <ko1@a...>
Date: Sat, 25 Jul 2015 10:49:27 +0900 (JST)
Subject: [ruby-changes:39290] nobu:r51371 (trunk): string.c: remove redundant call
nobu 2015-07-25 10:48:53 +0900 (Sat, 25 Jul 2015) New Revision: 51371 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51371 Log: string.c: remove redundant call * string.c (str_replace): remove redundant coderage copy as str_replace_shared already copys it. Modified files: trunk/string.c Index: string.c =================================================================== --- string.c (revision 51370) +++ string.c (revision 51371) @@ -1235,13 +1235,13 @@ str_replace(VALUE str, VALUE str2) https://github.com/ruby/ruby/blob/trunk/string.c#L1235 RSTRING(str)->as.heap.len = len; RSTRING(str)->as.heap.ptr = RSTRING_PTR(str2); STR_SET_SHARED(str, shared); + rb_enc_cr_str_exact_copy(str, str2); } else { str_replace_shared(str, str2); } OBJ_INFECT(str, str2); - rb_enc_cr_str_exact_copy(str, str2); return str; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/