Skip to content

Commit 2efcf8d

Browse files
author
Lillian Zhang
committed
Add fastpath for in place scrub
1 parent ec62fae commit 2efcf8d

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
@@ -1019,6 +1019,7 @@ def scrub(replace = nil, &block)
10191019
end
10201020

10211021
def scrub!(replace = nil, &block)
1022+
return self if valid_encoding?
10221023
replace(scrub(replace, &block))
10231024
self
10241025
end

0 commit comments

Comments
 (0)