Bug #2951
closedrange stop em method include? out of range
Description
=begin
This example stop ruby 1.9.1-p378
("01001-000".."99990-000").include? ""
=end
Updated by naruse (Yui NARUSE) about 14 years ago
- Status changed from Open to Rejected
=begin
It iterates (99990-1001) * 1000 + 1 = 98989001 times.
So it will nearly stopped.
=end
Updated by ariveira (Alexandre Riveira) about 14 years ago
=begin
ruby 1.8.7-p249 is minor of 0 seconds example
start_time = Time.now; ("01001-000".."99990-000").include? ""; puts Time.now - start_time
1.4e-05
=> nil
ruby 1.9.1
/usr/local/ruby-1.9.1-p378/bin/irb
irb(main):001:0> start_time = Time.now; ("01001-000".."99990-000").include? ""; puts Time.now - start_time
80.55897691
=> nil
Because ruby 1.8.7's extremely fast and ruby 1.9.1 is so slow?
This is a bug !
=end
Updated by marcandre (Marc-Andre Lafortune) about 14 years ago
=begin
Behavior has changed in 1.9. Please read the NEWS file:
http://github.com/ruby/ruby/blob/ruby_1_9_1/NEWS#L288
=end
Updated by ariveira (Alexandre Riveira) about 14 years ago
=begin
I used the method Range#cover? and now had the behavior I expected !
start_time = Time.now; ("01001-000".."99990-000").cover? ""; puts Time.now - start_time
2.1022e-05
=> nil
Tank's
Alexandre Riveira
=end