[前][次][番号順一覧][スレッド一覧]

ruby-changes:44698

From: mrkn <ko1@a...>
Date: Mon, 14 Nov 2016 01:32:15 +0900 (JST)
Subject: [ruby-changes:44698] mrkn:r56771 (trunk): complex.c: refactoring

mrkn	2016-11-14 01:22:26 +0900 (Mon, 14 Nov 2016)

  New Revision: 56771

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56771

  Log:
    complex.c: refactoring
    
    * complex.c (f_one_p): removed.

  Modified files:
    trunk/complex.c
Index: complex.c
===================================================================
--- complex.c	(revision 56770)
+++ complex.c	(revision 56771)
@@ -207,25 +207,6 @@ f_zero_p(VALUE x) https://github.com/ruby/ruby/blob/trunk/complex.c#L207
 #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)
 {
     return rb_obj_is_kind_of(x, c);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]