diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2022-09-08 22:12:02 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2022-09-09 16:03:20 +0900 |
commit | aff6534e32b5e46036808ed0579d31a8dbad8190 (patch) | |
tree | 5be487de6d4369ca940afc840f0d4754b4d00151 /tool | |
parent | 9faa9ced9640d23fc5dc1efd635f6b8ebc1a3ceb (diff) | |
download | ruby-aff6534e32b5e46036808ed0579d31a8dbad8190.tar.gz |
Avoid unnecessary copying when removing the leading part of a string
Remove the superfluous str_modify_keep_cr() call from rb_str_update().
It ends up calling either rb_str_drop_bytes() or rb_str_splice_0(),
which already does checks if necessary.
The extra call makes the string "independent". This is not always
wanted, in other words, it can keep the same shared root when merely
removing the leading part of a shared string.
Diffstat (limited to 'tool')
0 files changed, 0 insertions, 0 deletions