summaryrefslogtreecommitdiff
path: root/numeric.rb
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.rb')
-rw-r--r--numeric.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/numeric.rb b/numeric.rb
index c99a75a910..4dc406fd23 100644
--- a/numeric.rb
+++ b/numeric.rb
@@ -230,8 +230,8 @@ class Integer
# With no block given, returns an Enumerator.
def times
Primitive.attr! :inline_block
- unless block_given?
- return to_enum(:times) { self < 0 ? 0 : self }
+ unless defined?(yield)
+ return Primitive.cexpr! 'SIZED_ENUMERATOR(self, 0, 0, int_dotimes_size)'
end
i = 0
while i < self