Skip to content

Commit 071ee15

Browse files
committed
Fixes world aligns condition
1 parent 65adb00 commit 071ee15

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

code/enumerable/select-last-vs-reverse-detect.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
require 'benchmark/ips'
22

3-
ARRAY = [*1..100]
3+
ARRAY = [*1..7777]
44

55
def fast
6-
ARRAY.reverse.detect { |x| (x % 10).zero? }
6+
ARRAY.reverse.detect { |x| (x % 5).zero? }
77
end
88

99
def slow
10-
ARRAY.select { |x| (x % 10).zero? }.last
10+
ARRAY.select { |x| (x % 5).zero? }.last
1111
end
1212

1313
Benchmark.ips do |x|

0 commit comments

Comments
 (0)