diff options
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 41 |
1 files changed, 0 insertions, 41 deletions
@@ -1536,47 +1536,6 @@ str_discard(VALUE str) } void -rb_str_associate(VALUE str, VALUE add) -{ - /* sanity check */ - rb_check_frozen(str); - if (STR_ASSOC_P(str)) { - /* already associated */ - rb_ary_concat(RSTRING(str)->as.heap.aux.shared, add); - } - else { - if (STR_SHARED_P(str)) { - VALUE assoc = RSTRING(str)->as.heap.aux.shared; - str_make_independent(str); - if (STR_ASSOC_P(assoc)) { - assoc = RSTRING(assoc)->as.heap.aux.shared; - rb_ary_concat(assoc, add); - add = assoc; - } - } - else if (STR_EMBED_P(str)) { - str_make_independent(str); - } - else if (RSTRING(str)->as.heap.aux.capa != RSTRING_LEN(str)) { - RESIZE_CAPA(str, RSTRING_LEN(str)); - } - FL_SET(str, STR_ASSOC); - RBASIC_CLEAR_CLASS(add); - RB_OBJ_WRITE(str, &RSTRING(str)->as.heap.aux.shared, add); - } -} - -VALUE -rb_str_associated(VALUE str) -{ - if (STR_SHARED_P(str)) str = RSTRING(str)->as.heap.aux.shared; - if (STR_ASSOC_P(str)) { - return RSTRING(str)->as.heap.aux.shared; - } - return Qfalse; -} - -void rb_must_asciicompat(VALUE str) { rb_encoding *enc = rb_enc_get(str); |