Add rb_enc_set_index_fastpath and use it with rb_enc_cr_str_copy_for_substr by ima1zumi · Pull Request #6351 · ruby/ruby

The substring created by String#split is not frozen, and the encoding is always the correct encoding when taken from the original string. Therefore, we omitted the checks of frozen and encoding to ...