Skip to content
Browse files

Merge pull request #6424 from avakarev/refactoring_unless-else

Refactoring: just turn unless/else into if/else
  • Loading branch information...
2 parents ae8b09c + ff83df3 commit 9c3cd9cb8e2417ea0027f1c19cedfad32c62a0d2 @jeremy jeremy committed May 21, 2012
Showing with 9 additions and 9 deletions.
  1. +9 −9 actionpack/examples/performance.rb
View
18 actionpack/examples/performance.rb
@@ -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 9c3cd9c

Please sign in to comment.
Something went wrong with that request. Please try again.