Last active
April 20, 2019 20:07
-
-
Save Watson1978/1fb60d67180b1bbfa9ab18d36c02081a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo < String | |
ARG = ' '.freeze | |
def split(arg) | |
a = arg.source | |
if a == ARG | |
arg = ARG | |
end | |
super(arg) | |
end | |
end | |
str = Foo.new("a " * 1000) | |
10000.times do | |
str.split(/ /) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment