Skip to content

Commit 54071c6

Browse files
committed
Improve benchmark name extraction
Use Ruby methods to make the logic easier to understand.
1 parent c357a87 commit 54071c6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/results_table_builder.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,12 @@ def stddev_percent(values)
146146
end
147147

148148
def compute_bench_names
149-
# Get keys from all rows in case a benchmark failed for only some executables
150-
all_bench_names = @bench_data.map { |k, v| v.keys }.flatten.uniq
151149
benchmarks_metadata = YAML.load_file('benchmarks.yml')
152-
sort_benchmarks(all_bench_names, benchmarks_metadata)
150+
sort_benchmarks(all_benchmark_names, benchmarks_metadata)
151+
end
152+
153+
def all_benchmark_names
154+
@bench_data.values.flat_map(&:keys).uniq
153155
end
154156

155157
# Sort benchmarks with headlines first, then others, then micro

0 commit comments

Comments
 (0)