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

ruby-changes:42085

From: mame <ko1@a...>
Date: Fri, 18 Mar 2016 00:19:04 +0900 (JST)
Subject: [ruby-changes:42085] mame:r54159 (trunk): * numeric.c (num_step): use rb_equal for zero check. rb_num_coerce_cmp

mame	2016-03-18 00:18:59 +0900 (Fri, 18 Mar 2016)

  New Revision: 54159

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

  Log:
    * numeric.c (num_step): use rb_equal for zero check. rb_num_coerce_cmp
      created an object which caused extra overhead.

  Modified files:
    trunk/ChangeLog
    trunk/numeric.c
Index: numeric.c
===================================================================
--- numeric.c	(revision 54158)
+++ numeric.c	(revision 54159)
@@ -2224,7 +2224,7 @@ num_step(int argc, VALUE *argv, VALUE fr https://github.com/ruby/ruby/blob/trunk/numeric.c#L2224
     RETURN_SIZED_ENUMERATOR(from, argc, argv, num_step_size);
 
     desc = num_step_scan_args(argc, argv, &to, &step);
-    if (RTEST(rb_num_coerce_cmp(step, INT2FIX(0), id_eq))) {
+    if (rb_equal(step, INT2FIX(0))) {
 	inf = 1;
     }
     else if (RB_TYPE_P(to, T_FLOAT)) {
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54158)
+++ ChangeLog	(revision 54159)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Mar 18 00:15:05 2016  Yusuke Endoh  <mame@r...>
+
+	* numeric.c (num_step): use rb_equal for zero check. rb_num_coerce_cmp
+	  created an object which caused extra overhead. 
+
 Thu Mar 17 22:21:34 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/ruby.h (RB_GC_GUARD_PTR): remove intermediate

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

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