diff options
author | Peter Zhu <[email protected]> | 2023-05-31 09:57:33 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-06-01 08:32:29 -0400 |
commit | 8a8618d4f3b35a5f114a3a5e05c80a7edb30546c (patch) | |
tree | b5d2dc31d778163c764b6c27817b8703c68c6895 /string.c | |
parent | d5a5333168690ea1e3453cdb6a5d042f46ba80b8 (diff) |
Don't refetch ptr and len
The call to RSTRING_GETMEM already fetched the pointer and length, so we
don't need to fetch it again.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7879
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 0 insertions, 4 deletions
@@ -3057,13 +3057,9 @@ str_buf_cat4(VALUE str, const char *ptr, long len, bool keep_cr) if (STR_EMBED_P(str)) { capa = str_embed_capa(str) - termlen; - sptr = RSTRING(str)->as.embed.ary; - olen = RSTRING_EMBED_LEN(str); } else { capa = RSTRING(str)->as.heap.aux.capa; - sptr = RSTRING(str)->as.heap.ptr; - olen = RSTRING(str)->as.heap.len; } if (olen > LONG_MAX - len) { rb_raise(rb_eArgError, "string sizes too big"); |