diff options
author | Mau Magnaguagno <maumagnaguagno@gmail.com> | 2023-11-01 15:40:40 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-01 18:40:40 +0000 |
commit | d3ea9070bbbf04749e5fcd8339d71a9e73a86cfb (patch) | |
tree | 87813feaa96ea452b98b30e2e32e6cd9bba7a80c /yjit.rb | |
parent | 909afcb4fca393ce75cc63edc7656fd95a64f0f9 (diff) |
YJIT: skip to_a in format_number (#8815)
String#chars returns an array instead of an enumerator since Ruby 2.0.
Diffstat (limited to 'yjit.rb')
-rw-r--r-- | yjit.rb | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -435,7 +435,7 @@ module RubyVM::YJIT # Format large numbers with comma separators for readability def format_number(pad, number) integer, decimal = number.to_s.split(".") - d_groups = integer.chars.to_a.reverse.each_slice(3) + d_groups = integer.chars.reverse.each_slice(3) with_commas = d_groups.map(&:join).join(',').reverse formatted = [with_commas, decimal].compact.join(".") formatted.rjust(pad, ' ') |