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

ruby-changes:27544

From: drbrain <ko1@a...>
Date: Tue, 5 Mar 2013 12:26:04 +0900 (JST)
Subject: [ruby-changes:27544] drbrain:r39596 (trunk): * enumerator.c (enumerator_with_index): Restore handling of a nil memo

drbrain	2013-03-05 12:25:55 +0900 (Tue, 05 Mar 2013)

  New Revision: 39596

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

  Log:
    * enumerator.c (enumerator_with_index):  Restore handling of a nil memo
      from r39594.

  Modified files:
    trunk/ChangeLog
    trunk/enumerator.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39595)
+++ ChangeLog	(revision 39596)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Mar  5 12:24:23 2013  Eric Hodel  <drbrain@s...>
+
+	* enumerator.c (enumerator_with_index):  Restore handling of a nil memo
+	  from r39594.
+
 Tue Mar  5 10:40:22 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/objspace/objspace.c (count_nodes): count also newly added nodes,
Index: enumerator.c
===================================================================
--- enumerator.c	(revision 39595)
+++ enumerator.c	(revision 39596)
@@ -492,6 +492,8 @@ enumerator_with_index(int argc, VALUE *a https://github.com/ruby/ruby/blob/trunk/enumerator.c#L492
 
     rb_scan_args(argc, argv, "01", &memo);
     RETURN_SIZED_ENUMERATOR(obj, argc, argv, enumerator_size);
+    if (NIL_P(memo))
+	memo = INT2NUM(0);
     return enumerator_block_call(obj, enumerator_with_index_i, (VALUE)&memo);
 }
 

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

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