From 601b83dcfc7e14bab66cbe549a4f736f971a03ed Mon Sep 17 00:00:00 2001 From: Matt Valentine-House Date: Thu, 9 Feb 2023 13:16:46 +0000 Subject: Remove alias macro rb_str_splice --- string.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index d9ade2946c..cf3d0cd218 100644 --- a/string.c +++ b/string.c @@ -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; } -- cgit v1.2.1