Skip to content

Instantly share code, notes, and snippets.

@Watson1978
Last active April 20, 2019 20:07
Show Gist options
  • Save Watson1978/1fb60d67180b1bbfa9ab18d36c02081a to your computer and use it in GitHub Desktop.
Save Watson1978/1fb60d67180b1bbfa9ab18d36c02081a to your computer and use it in GitHub Desktop.
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