diff options
author | Alan Wu <[email protected]> | 2020-10-30 19:34:41 -0400 |
---|---|---|
committer | Alan Wu <[email protected]> | 2020-10-30 19:34:41 -0400 |
commit | 520b86caf1b6e954c5fbe61a3a83bc5b4716c988 (patch) | |
tree | 09f90df10d33c34eb071db651918e84b0af41e6c /string.c | |
parent | bd6cd851552df411053c1e3154ee781e7d1adadf (diff) |
Move variable closer to usage
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3563,7 +3563,6 @@ rb_strseq_index(VALUE str, VALUE sub, long offset, int in_byte) { const char *str_ptr, *str_ptr_end, *sub_ptr; long str_len, sub_len; - int single_byte = single_byte_optimizable(str); rb_encoding *enc; enc = rb_enc_check(str, sub); @@ -3579,6 +3578,7 @@ rb_strseq_index(VALUE str, VALUE sub, long offset, int in_byte) if (offset != 0) { long str_len_char, sub_len_char; + int single_byte = single_byte_optimizable(str); str_len_char = (in_byte || single_byte) ? str_len : str_strlen(str, enc); sub_len_char = in_byte ? sub_len : str_strlen(sub, enc); if (offset < 0) { |