aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/examples/performance.rb
diff options
context:
space:
mode:
authorAndrey Vakarev <avakarev@gmail.com>2012-05-21 19:13:24 +0300
committerAndrey Vakarev <avakarev@gmail.com>2012-05-21 19:13:24 +0300
commitff83df36a48103675f16152f9d6bf67e11ea9f1a (patch)
treee13b7abaadb99ba4c9820133b1389f13145d7df9 /actionpack/examples/performance.rb
parentae8b09c310989860ed37df072ffa7c6a533bf5ba (diff)
downloadrails-ff83df36a48103675f16152f9d6bf67e11ea9f1a.tar.gz
rails-ff83df36a48103675f16152f9d6bf67e11ea9f1a.tar.bz2
rails-ff83df36a48103675f16152f9d6bf67e11ea9f1a.zip
Refactoring: turn unless/else into if/else
Diffstat (limited to 'actionpack/examples/performance.rb')
-rw-r--r--actionpack/examples/performance.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/actionpack/examples/performance.rb b/actionpack/examples/performance.rb
index 994e745bb0..8ea4758961 100644
--- a/actionpack/examples/performance.rb
+++ b/actionpack/examples/performance.rb
@@ -166,15 +166,7 @@ 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
@@ -182,4 +174,12 @@ else
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 \ No newline at end of file