test/prime.rb in ruby-prof-1.1.0 vs test/prime.rb in ruby-prof-1.2.0
- old
+ new
@@ -2,12 +2,10 @@
# is intentionally badly designed to show off the use
# of ruby-prof.
#
# Source from http://people.cs.uchicago.edu/~bomb154/154/maclabs/profilers-lab/
-require File.expand_path('../test_helper', __FILE__)
-
def make_random_array(length, maxnum)
result = Array.new(length)
result.each_index do |i|
result[i] = rand(maxnum)
end
@@ -42,10 +40,10 @@
end
end
largest
end
-def run_primes(length=10, maxnum=1000)
+def run_primes(length=10, maxnum=1_000)
# Create random numbers
random_array = make_random_array(length, maxnum)
# Find the primes
primes = find_primes(random_array)