From 4739299791938696727e96d359c566cca3b4582a Mon Sep 17 00:00:00 2001 From: mrkn Date: Sun, 13 Nov 2016 16:22:26 +0000 Subject: complex.c: refactoring * complex.c (f_one_p): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- complex.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'complex.c') diff --git a/complex.c b/complex.c index e2a7efb262..0f9a8d314d 100644 --- a/complex.c +++ b/complex.c @@ -206,25 +206,6 @@ f_zero_p(VALUE x) #define f_nonzero_p(x) (!f_zero_p(x)) -inline static VALUE -f_one_p(VALUE x) -{ - if (FIXNUM_P(x)) { - return f_boolcast(FIX2LONG(x) == 1); - } - else if (RB_TYPE_P(x, T_BIGNUM)) { - return Qfalse; - } - else if (RB_TYPE_P(x, T_RATIONAL)) { - VALUE num = RRATIONAL(x)->num; - VALUE den = RRATIONAL(x)->den; - - return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 1 && - FIXNUM_P(den) && FIX2LONG(den) == 1); - } - return rb_funcall(x, id_eqeq_p, 1, ONE); -} - inline static VALUE f_kind_of_p(VALUE x, VALUE c) { -- cgit v1.2.3