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

ruby-changes:38458

From: nobu <ko1@a...>
Date: Tue, 19 May 2015 13:13:40 +0900 (JST)
Subject: [ruby-changes:38458] nobu:r50539 (trunk): numeric.c: return true

nobu	2015-05-19 13:13:22 +0900 (Tue, 19 May 2015)

  New Revision: 50539

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

  Log:
    numeric.c: return true
    
    * numeric.c (num_positive_p): return true instead of Fixnum 0.
      [ruby-core:69173] [Feature #11151]

  Modified files:
    trunk/numeric.c
Index: numeric.c
===================================================================
--- numeric.c	(revision 50538)
+++ numeric.c	(revision 50539)
@@ -662,13 +662,13 @@ num_positive_p(VALUE num) https://github.com/ruby/ruby/blob/trunk/numeric.c#L662
 
     if (FIXNUM_P(num)) {
 	if (method_basic_p(rb_cFixnum))
-	    return (SIGNED_VALUE)num > (SIGNED_VALUE)INT2FIX(0);
+	    return (SIGNED_VALUE)num > (SIGNED_VALUE)INT2FIX(0) ? Qtrue : Qfalse;
     }
     else if (RB_TYPE_P(num, T_BIGNUM)) {
 	if (method_basic_p(rb_cBignum))
-	    return BIGNUM_POSITIVE_P(num) && !rb_bigzero_p(num);
+	    return BIGNUM_POSITIVE_P(num) && !rb_bigzero_p(num) ? Qtrue : Qfalse;
     }
-    return RTEST(compare_with_zero(num, mid));
+    return compare_with_zero(num, mid);
 }
 
 /*

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

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