aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-25 01:48:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-25 01:48:53 +0000
commitcdd8ce2632b5c38caf27ab40aa27ea4b0011fa14 (patch)
tree7a1604ea8b697bc8fbbb6779c7e9780a6cf4b6e9 /string.c
parentf47ff783e76dbab76433efb690155ae46dee04b4 (diff)
downloadruby-cdd8ce2632b5c38caf27ab40aa27ea4b0011fa14.tar.gz
string.c: remove redundant call
* string.c (str_replace): remove redundant coderage copy as str_replace_shared already copys it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index b8f55b7fac..08fa48b791 100644
--- a/string.c
+++ b/string.c
@@ -1235,13 +1235,13 @@ str_replace(VALUE str, VALUE str2)
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;
}