Permalink
Browse files

Update Ruby sieve implementation for benchmark to be faster

  • Loading branch information...
1 parent 8e49013 commit 8f2686ffa86a29a203a3893d56e7459a841ba9b3 @joshuaclayton committed Nov 14, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 Rakefile
View
@@ -20,7 +20,7 @@ task(:benchmark => :build) do
require "sieve"
def sieve(n)
- numbers = (0..n).map {|i| i }
+ numbers = (0..n).to_a
numbers[0] = numbers[1] = nil
numbers.each do |num|
next unless num

0 comments on commit 8f2686f

Please sign in to comment.