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

ruby-changes:39185

From: nobu <ko1@a...>
Date: Thu, 16 Jul 2015 21:29:44 +0900 (JST)
Subject: [ruby-changes:39185] nobu:r51266 (trunk): string.c: remove redundant calls

nobu	2015-07-16 21:29:23 +0900 (Thu, 16 Jul 2015)

  New Revision: 51266

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

  Log:
    string.c: remove redundant calls
    
    * string.c (rb_str_enumerate_lines): do not check if a block is
      given twice.  RETURN_ENUMERATOR includes rb_block_given_p()
      check which is redundant here.

  Modified files:
    trunk/string.c
Index: string.c
===================================================================
--- string.c	(revision 51265)
+++ string.c	(revision 51266)
@@ -6709,7 +6709,7 @@ rb_str_enumerate_lines(int argc, VALUE * https://github.com/ruby/ruby/blob/trunk/string.c#L6709
 	if (wantarray)
 	    ary = rb_ary_new();
 	else
-	    RETURN_ENUMERATOR(str, argc, argv);
+	    return SIZED_ENUMERATOR(str, argc, argv, 0);
     }
 
     if (NIL_P(rs)) {

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

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