Sha256: 94f15ab9a41bc3dbe75e019b00467995d59f75a94b38a17c2a6e166646c69e0a

Contents?: true

Size: 116 Bytes

Versions: 27

Compression:

Stored size: 116 Bytes

Contents

def slow
  ARRAY.select { |x| (x % 10).zero? }.last
end

def fast
  ARRAY.reverse.detect { |x| (x % 10).zero? }
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
fasterer-0.11.0 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.10.1 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.10.0 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.9.0 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.8.3 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.8.2 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.8.1 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.8.0 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.7.1 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.7.0 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.6.0 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.5.1 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.5.0 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.4.2 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.4.1 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.4.0 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.3.2 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.3.1 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.3.0 spec/support/analyzer/25_select_last_vs_reverse_detect.rb
fasterer-0.2.1 spec/support/analyzer/25_select_last_vs_reverse_detect.rb