YJIT: skip map in print_sorted_exit_counts (#6954)

Array#sum accepts a block.
This commit is contained in:
Mau Magnaguagno 2022-12-19 12:44:23 -03:00 committed by GitHub
parent 1482f0649e
commit b2f53dccbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2022-12-19 15:44:42 +00:00
Merged-By: maximecb <maximecb@ruby-lang.org>

View File

@ -303,7 +303,7 @@ module RubyVM::YJIT
total_exits = total_exit_count(stats)
if total_exits > 0
top_n_total = exits.map { |name, count| count }.sum
top_n_total = exits.sum { |name, count| count }
top_n_exit_pct = 100.0 * top_n_total / total_exits
$stderr.puts "Top-#{exits.size} most frequent exit ops (#{"%.1f" % top_n_exit_pct}% of exits):"