ZJIT: Skip empty counter sections in stats

This commit is contained in:
Shannon Skipper 2025-11-16 09:01:50 -08:00 committed by Alan Wu
parent 6566003712
commit cbe65ebbc3
Notes: git 2025-11-18 21:58:18 +00:00

View File

@ -297,7 +297,7 @@ class << RubyVM::ZJIT
def print_counters_with_prefix(buf:, stats:, prefix:, prompt:, limit: nil)
counters = stats.select { |key, value| key.start_with?(prefix) && value > 0 }
return if stats.empty?
return if counters.empty?
counters.transform_keys! { |key| key.to_s.delete_prefix(prefix) }
key_pad = counters.keys.map(&:size).max