summaryrefslogtreecommitdiff
path: root/yjit.rb
diff options
context:
space:
mode:
authorMau Magnaguagno <maumagnaguagno@gmail.com>2023-11-01 15:40:40 -0300
committerGitHub <noreply@github.com>2023-11-01 18:40:40 +0000
commitd3ea9070bbbf04749e5fcd8339d71a9e73a86cfb (patch)
tree87813feaa96ea452b98b30e2e32e6cd9bba7a80c /yjit.rb
parent909afcb4fca393ce75cc63edc7656fd95a64f0f9 (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.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/yjit.rb b/yjit.rb
index c39175d12d..50b5aa6ccb 100644
--- a/yjit.rb
+++ b/yjit.rb
@@ -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, ' ')