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

ruby-changes:23729

From: drbrain <ko1@a...>
Date: Fri, 25 May 2012 08:52:05 +0900 (JST)
Subject: [ruby-changes:23729] drbrain:r35780 (trunk): * enum.c (enum_count): Enumerable#count no longer uses #size when

drbrain	2012-05-25 08:51:56 +0900 (Fri, 25 May 2012)

  New Revision: 35780

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

  Log:
    * enum.c (enum_count):  Enumerable#count no longer uses #size when
      counting elements.  Patch by Nobuhiro IMAI.  [ruby-trunk - Bug #6473]

  Modified files:
    trunk/ChangeLog
    trunk/enum.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 35779)
+++ ChangeLog	(revision 35780)
@@ -1,3 +1,8 @@
+Fri May 25 08:51:39 2012  Eric Hodel  <drbrain@s...>
+
+	* enum.c (enum_count):  Enumerable#count no longer uses #size when
+	  counting elements.  Patch by Nobuhiro IMAI.  [ruby-trunk - Bug #6473]
+
 Fri May 25 01:15:39 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* sprintf.c (ruby__sfvextra): [EXPERIMENTAL] use inspect instead of
Index: enum.c
===================================================================
--- enum.c	(revision 35779)
+++ enum.c	(revision 35780)
@@ -130,11 +130,10 @@
  *     enum.count(item)           -> int
  *     enum.count { |obj| block } -> int
  *
- *  Returns the number of items in <i>enum</i> if it responds to a #size call,
- *  otherwise the items are counted through enumeration.  If an argument is
- *  given the number of items in <i>enum</i> that are equal to <i>item</i> are
- *  counted.  If a block is given, it counts the number of elements yielding a
- *  true value.
+ *  Returns the number of items in +enum+ through enumeration.
+ *  If an argument is given, the number of items in +enum+ that
+ *  are equal to +item+ are counted.  If a block is given, it
+ *  counts the number of elements yielding a true value.
  *
  *     ary = [1, 2, 4, 2]
  *     ary.count               #=> 4

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

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