summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
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;