diff options
author | Matt Valentine-House <matt@eightbitraptor.com> | 2023-02-09 13:16:46 +0000 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-02-09 15:02:26 -0500 |
commit | 601b83dcfc7e14bab66cbe549a4f736f971a03ed (patch) | |
tree | e9380a1cc8d7de664ab50583744cc98ddad0fd3a /string.c | |
parent | b9e6580135d20cf3fff2e872b3e54c08e96468cb (diff) | |
download | ruby-601b83dcfc7e14bab66cbe549a4f736f971a03ed.tar.gz |
Remove alias macro rb_str_splice
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -5343,8 +5343,6 @@ rb_str_update(VALUE str, long beg, long len, VALUE val) ENC_CODERANGE_SET(str, cr); } -#define rb_str_splice(str, beg, len, val) rb_str_update(str, beg, len, val) - static void rb_str_subpat_set(VALUE str, VALUE re, VALUE backref, VALUE val) { @@ -5395,7 +5393,7 @@ rb_str_aset(VALUE str, VALUE indx, VALUE val) rb_raise(rb_eIndexError, "string not matched"); } beg = rb_str_sublen(str, beg); - rb_str_splice(str, beg, str_strlen(indx, NULL), val); + rb_str_update(str, beg, str_strlen(indx, NULL), val); return val; default: @@ -5403,7 +5401,7 @@ rb_str_aset(VALUE str, VALUE indx, VALUE val) { long beg, len; if (rb_range_beg_len(indx, &beg, &len, str_strlen(str, NULL), 2)) { - rb_str_splice(str, beg, len, val); + rb_str_update(str, beg, len, val); return val; } } @@ -5411,7 +5409,7 @@ rb_str_aset(VALUE str, VALUE indx, VALUE val) case T_FIXNUM: idx = NUM2LONG(indx); - rb_str_splice(str, idx, 1, val); + rb_str_update(str, idx, 1, val); return val; } } @@ -5453,7 +5451,7 @@ rb_str_aset_m(int argc, VALUE *argv, VALUE str) rb_str_subpat_set(str, argv[0], argv[1], argv[2]); } else { - rb_str_splice(str, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]); + rb_str_update(str, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]); } return argv[2]; } @@ -5490,7 +5488,7 @@ rb_str_insert(VALUE str, VALUE idx, VALUE str2) else if (pos < 0) { pos++; } - rb_str_splice(str, pos, 0, str2); + rb_str_update(str, pos, 0, str2); return str; } |