diff options
author | Jean Boussier <[email protected]> | 2022-09-08 12:43:03 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2022-09-08 15:02:21 +0200 |
commit | cd1724bddeac5dd4c01ab0a2d527110fff9cf5f9 (patch) | |
tree | 99ddf71d00f6db7e2ebc3789b2037668e3db54cf /string.c | |
parent | e0cd466ae71cd483b73d28128df1a02dd52fcb92 (diff) |
rb_str_concat_literals: use rb_str_buf_append
That's about 1.30x faster.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6334
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -3393,8 +3393,7 @@ rb_str_concat_literals(size_t num, const VALUE *strary) const VALUE v = strary[i]; int encidx = ENCODING_GET(v); - rb_enc_cr_str_buf_cat(str, RSTRING_PTR(v), RSTRING_LEN(v), - encidx, ENC_CODERANGE(v), NULL); + rb_str_buf_append(str, v); if (encidx != ENCINDEX_US_ASCII) { if (ENCODING_GET_INLINED(str) == ENCINDEX_US_ASCII) rb_enc_set_index(str, encidx); |