I called the following statements on a range triples = "AAA".."ZZZ"
:
triples.include? "ABC" # => true: slow in ruby 1.9 and fast in ruby 1.8
I understood why the output is
true
, but couldn't get why it's fast in ruby 1.8 and slow in ruby 1.9.triples.include? "ABCD" # => false: ruby 1.9 and true: ruby 1.8
I couldn't get why the output is different in both versions.
triples.cover? "ABCD" # => true and fast in ruby 1.9
The same problem as the second statement.
Why are cover?
and include?
statements different in ruby 1.9?