Skip to content

Commit

Permalink
Refactoring: turn unless/else into if/else
Browse files Browse the repository at this point in the history
  • Loading branch information
avakarev committed May 21, 2012
1 parent ae8b09c commit ff83df3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions actionpack/examples/performance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,20 @@ def run_all!(times, verbose)
Runner.run(:diff_100, times, verbose)
end

unless ENV["PROFILE"]
run_all!(1, false)

(ENV["M"] || 1).to_i.times do
$ran = []
run_all!(N, true)
Runner.done
end
else
if ENV["PROFILE"]
Runner.run(ENV["PROFILE"].to_sym, 1, false)
require "ruby-prof"
RubyProf.start
Runner.run(ENV["PROFILE"].to_sym, N, true)
result = RubyProf.stop
printer = RubyProf::CallStackPrinter.new(result)
printer.print(File.open("output.html", "w"))
else
run_all!(1, false)

(ENV["M"] || 1).to_i.times do
$ran = []
run_all!(N, true)
Runner.done
end
end

0 comments on commit ff83df3

Please sign in to comment.