summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-08-27 05:02:29 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-08-27 05:02:29 +0000
commitb67fae3712b782c7910a2b85ef7302eda7562c25 (patch)
tree87ab7425e3394f97e33bbf86c6064019c6c552a4 /string.c
parent00a7d49b422b5cca81120e370c97c4ce0d864fe8 (diff)
Revert a part of r67767
it was not necessary for ruby_2_5. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/string.c b/string.c
index 1f52f26f83..ed7da23649 100644
--- a/string.c
+++ b/string.c
@@ -1136,13 +1136,6 @@ str_replace_shared_without_enc(VALUE str2, VALUE str)
root = rb_str_new_frozen(str);
RSTRING_GETMEM(root, ptr, len);
}
- if (!STR_EMBED_P(str2) && !FL_TEST_RAW(str2, STR_SHARED|STR_NOFREE)) {
- /* TODO: check if str2 is a shared root */
- char *ptr2 = STR_HEAP_PTR(str2);
- if (ptr2 != ptr) {
- ruby_sized_xfree(ptr2, STR_HEAP_SIZE(str2));
- }
- }
FL_SET(str2, STR_NOEMBED);
RSTRING(str2)->as.heap.len = len;
RSTRING(str2)->as.heap.ptr = ptr;