Skip to content

Commit 59e137c

Browse files
committed
Avoid an extra Range allocation for #rest in interpreter
1 parent 13961d4 commit 59e137c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/strscan/truffleruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def pos=(new_pos)
5959

6060
def charpos = Primitive.string_byte_index_to_character_index(@string, @pos)
6161

62-
def rest = @string.byteslice(@pos..)
62+
def rest = @string.byteslice(@pos, @string.bytesize)
6363

6464
def rest_size = @string.bytesize - @pos
6565

0 commit comments

Comments
 (0)