diff options
author | Aaron Patterson <[email protected]> | 2024-07-29 13:28:57 -0700 |
---|---|---|
committer | Aaron Patterson <[email protected]> | 2024-07-29 14:18:11 -0700 |
commit | 2c1655314a0700a90b7ed12bf8c920ad2d78654f (patch) | |
tree | ec758c9e97cc71adf644b85a622c279766ad8646 /numeric.rb | |
parent | acbb8d4fb56ac3b5894991760a075dbef78d10e3 (diff) |
Revert moving things to Ruby
This is slowing down benchmarks on x86, so lets revert it for now.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11275
Diffstat (limited to 'numeric.rb')
-rw-r--r-- | numeric.rb | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/numeric.rb b/numeric.rb index 898b257fe4..4dc406fd23 100644 --- a/numeric.rb +++ b/numeric.rb @@ -241,36 +241,6 @@ class Integer self end - # call-seq: - # downto(limit) {|i| ... } -> self - # downto(limit) -> enumerator - # - # Calls the given block with each integer value from +self+ down to +limit+; - # returns +self+: - # - # a = [] - # 10.downto(5) {|i| a << i } # => 10 - # a # => [10, 9, 8, 7, 6, 5] - # a = [] - # 0.downto(-5) {|i| a << i } # => 0 - # a # => [0, -1, -2, -3, -4, -5] - # 4.downto(5) {|i| fail 'Cannot happen' } # => 4 - # - # With no block given, returns an Enumerator. - def downto to - Primitive.attr! :inline_block - unless defined?(yield) - return Primitive.cexpr! 'SIZED_ENUMERATOR(self, 1, &to, int_downto_size)' - end - - from = self - while from >= to - yield from - from = from.pred - end - self - end - # call-seq: # to_i -> self # |