summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-09-01 09:18:44 -0700
committerJeremy Evans <code@jeremyevans.net>2020-09-01 10:52:47 -0700
commite080a4cdeeb55dddb6247ffd2563d2dc8b84c919 (patch)
treef4baeaf92261d00d710dad565f69df6ca74e5383 /range.c
parent94430d009a7018c9d6447fe6814a51b664ad46a9 (diff)
Revert "Special case Range#max for integer beginning and Float::Infinity end"
This reverts commit 05bf811c2839628aaef3d565daedb28be80d47ef.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3500
Diffstat (limited to 'range.c')
-rw-r--r--range.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/range.c b/range.c
index 6d507ea124f..124d9faa51b 100644
--- a/range.c
+++ b/range.c
@@ -1255,15 +1255,6 @@ range_max(int argc, VALUE *argv, VALUE range)
return rb_funcall(e, '-', 1, INT2FIX(1));
}
if (RB_INTEGER_TYPE_P(b) && !RB_INTEGER_TYPE_P(e)) {
- if (RB_TYPE_P(e, T_FLOAT)) {
- VALUE inf = rb_funcall(e, rb_intern("infinite?"), 0);
- if (inf != Qnil) {
- /* For backwards compatibility, return end if the end
- * is Float::Infinity and the beginning is integer.
- If end is -Float::Infinity, return nil. */
- return(inf == INT2FIX(1) ? e : Qnil);
- }
- }
e = rb_funcall(e, rb_intern("floor"), 0);
}
return e;