summaryrefslogtreecommitdiffhomepage
path: root/mrblib
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-01-18 16:16:48 +0900
committerGitHub <[email protected]>2019-01-18 16:16:48 +0900
commit3d32be6f3edefa335b1c93cccfc21dde1f6e1e77 (patch)
tree85ded80c360df6ad1e86b51991e208a59c425058 /mrblib
parent9a2366ded6a3c2ddfc203d9f53b1c377d626c207 (diff)
parent8969edf03b2f4ff8537974c2bd30e9abe2002da6 (diff)
downloadmruby-3d32be6f3edefa335b1c93cccfc21dde1f6e1e77.tar.gz
mruby-3d32be6f3edefa335b1c93cccfc21dde1f6e1e77.zip
Merge pull request #4231 from shuujii/avoid-runtime-eval-for-without-float
Avoid runtime evaluation for `MRB_WITHOUT_FLOAT`
Diffstat (limited to 'mrblib')
-rw-r--r--mrblib/numeric.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/mrblib/numeric.rb b/mrblib/numeric.rb
index dfdaf9da8..5a3c5eb58 100644
--- a/mrblib/numeric.rb
+++ b/mrblib/numeric.rb
@@ -104,14 +104,7 @@ module Integral
raise ArgumentError, "step can't be 0" if step == 0
return to_enum(:step, num, step) unless block
- i = self
- if Object.const_defined?(:Float) &&
- (kind_of?(Float) || num.kind_of?(Float) || step.kind_of?(Float))
- i = i.to_f
- num = num.to_f unless num == nil
- step = step.to_f
- end
-
+ i = __coerce_step_counter(num, step)
if num == nil
while true
block.call(i)