summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-05 07:01:26 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-05 07:01:26 (GMT)
commita161bdf6f3f2f522579c9b7e19ede2a1c9790013 (patch)
tree7cab8a0df6f5ef9dd4a4bab1dc2882ced66b220c /benchmark
parent418d915f7be3d8dbbe9c761fa48f93eca746fdea (diff)
driver.rb: fix index
* benchmark/driver.rb (show_results): fix index of results. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/driver.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
index c9fec00..58d4c5b 100644
--- a/benchmark/driver.rb
+++ b/benchmark/driver.rb
@@ -168,10 +168,10 @@ class BenchmarkDriver
output if markdown
output ["name".ljust(name_width), @execs.map.with_index{|(_, v), i| sprintf(strformat, v, width[i])}].join("").rstrip
output ["-"*name_width, width.map{|n|":".rjust(n, "-")}].join("|") if markdown
- @results.each_with_index{|(v, result), i|
+ @results.each{|v, result|
rets = []
s = adjusted_results(v, result){|r|
- rets << sprintf(numformat, r, width[i])
+ rets << sprintf(numformat, r, width[rets.size])
}
v += s if s
output [v.ljust(name_width), rets].join("")
@@ -183,7 +183,7 @@ class BenchmarkDriver
output if markdown
output ["name".ljust(name_width), @execs[1..-1].map.with_index{|(_, v), i| sprintf(strformat, v, width[i])}].join("").rstrip
output ["-"*name_width, width[1..-1].map{|n|":".rjust(n, "-")}].join("|") if markdown
- @results.each_with_index{|(v, result), i|
+ @results.each{|v, result|
rets = []
first_value = nil
s = adjusted_results(v, result){|r|
@@ -191,7 +191,7 @@ class BenchmarkDriver
if r == 0
rets << "Error"
else
- rets << sprintf(numformat, first_value/r, width[i])
+ rets << sprintf(numformat, first_value/r, width[rets.size+1])
end
else
first_value = r