ruby-changes:67554
From: S-H-GAMELINKS <ko1@a...>
Date: Thu, 2 Sep 2021 17:39:47 +0900 (JST)
Subject: [ruby-changes:67554] d1d76f2428 (master): Refactor f_infinite_p function
https://git.ruby-lang.org/ruby.git/commit/?id=d1d76f2428 From d1d76f24288993b4f004770397a05c0be8ac13b4 Mon Sep 17 00:00:00 2001 From: S-H-GAMELINKS <gamelinks007@g...> Date: Wed, 1 Sep 2021 12:11:38 +0900 Subject: Refactor f_infinite_p function --- complex.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/complex.c b/complex.c index da69f91..3fbda12 100644 --- a/complex.c +++ b/complex.c @@ -354,15 +354,12 @@ VALUE rb_flo_is_infinite_p(VALUE num); https://github.com/ruby/ruby/blob/trunk/complex.c#L354 inline static VALUE f_infinite_p(VALUE x) { - if (RB_INTEGER_TYPE_P(x)) { + if (RB_INTEGER_TYPE_P(x) || RB_TYPE_P(x, T_RATIONAL)) { return Qnil; } else if (RB_FLOAT_TYPE_P(x)) { return rb_flo_is_infinite_p(x); } - else if (RB_TYPE_P(x, T_RATIONAL)) { - return Qnil; - } return rb_funcallv(x, id_infinite_p, 0, 0); } -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/