Skip to content

Commit 848f776

Browse files
committed
Always split String#scan to have a useful inline cache when given a String pattern
1 parent c481031 commit 848f776

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/ruby/truffleruby/core/string.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ def scan(pattern, &block)
316316
Primitive.regexp_last_match_set(Primitive.caller_special_variables, last_match)
317317
ret
318318
end
319+
Truffle::Graal.always_split(instance_method(:scan))
319320

320321
def split(pattern = nil, limit = undefined, &block)
321322
Truffle::Splitter.split(Primitive.dup_as_string_instance(self), pattern, limit, &block)

0 commit comments

Comments
 (0)