aboutsummaryrefslogtreecommitdiffstats
path: root/lib/benchmark.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-08 20:59:01 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-08 20:59:01 +0000
commitf3e35474078895e1d178e15cfbfc6743f9ffc62d (patch)
treea3fd49329f497133415a7ec11592b5c693459608 /lib/benchmark.rb
parentcceca83afe046b8c2b53eab6ab7c52faa1719b6d (diff)
downloadruby-f3e35474078895e1d178e15cfbfc6743f9ffc62d.tar.gz
* lib/*.rb: Remove unused variable warnings.
Patch by Run Paint [ruby-core:30991] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/benchmark.rb')
-rw-r--r--lib/benchmark.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/benchmark.rb b/lib/benchmark.rb
index 8e7f778e2d..d251fc7e88 100644
--- a/lib/benchmark.rb
+++ b/lib/benchmark.rb
@@ -558,16 +558,16 @@ if __FILE__ == $0
n = ARGV[0].to_i.nonzero? || 50000
puts %Q([#{n} times iterations of `a = "1"'])
benchmark(" " + CAPTION, 7, FMTSTR) do |x|
- x.report("for:") {for i in 1..n; a = "1"; end} # Benchmark::measure
- x.report("times:") {n.times do ; a = "1"; end}
- x.report("upto:") {1.upto(n) do ; a = "1"; end}
+ x.report("for:") {for _ in 1..n; _ = "1"; end} # Benchmark::measure
+ x.report("times:") {n.times do ; _ = "1"; end}
+ x.report("upto:") {1.upto(n) do ; _ = "1"; end}
end
benchmark do
[
- measure{for i in 1..n; a = "1"; end}, # Benchmark::measure
- measure{n.times do ; a = "1"; end},
- measure{1.upto(n) do ; a = "1"; end}
+ measure{for _ in 1..n; _ = "1"; end}, # Benchmark::measure
+ measure{n.times do ; _ = "1"; end},
+ measure{1.upto(n) do ; _ = "1"; end}
]
end
end