aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2012-05-21 09:17:20 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2012-05-21 09:17:20 -0700
commit9c3cd9cb8e2417ea0027f1c19cedfad32c62a0d2 (patch)
treee13b7abaadb99ba4c9820133b1389f13145d7df9
parentae8b09c310989860ed37df072ffa7c6a533bf5ba (diff)
parentff83df36a48103675f16152f9d6bf67e11ea9f1a (diff)
downloadrails-9c3cd9cb8e2417ea0027f1c19cedfad32c62a0d2.tar.gz
rails-9c3cd9cb8e2417ea0027f1c19cedfad32c62a0d2.tar.bz2
rails-9c3cd9cb8e2417ea0027f1c19cedfad32c62a0d2.zip
Merge pull request #6424 from avakarev/refactoring_unless-else
Refactoring: just turn unless/else into if/else
-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