* enum.c (enum_count): Enumerable#count no longer uses #size when
counting elements. Patch by Nobuhiro IMAI. [ruby-trunk - Bug #6473] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
80aaa3ef6c
commit
38f0dd0aba
@ -1,3 +1,8 @@
|
|||||||
|
Fri May 25 08:51:39 2012 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Fri May 25 01:15:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* sprintf.c (ruby__sfvextra): [EXPERIMENTAL] use inspect instead of
|
* sprintf.c (ruby__sfvextra): [EXPERIMENTAL] use inspect instead of
|
||||||
|
9
enum.c
9
enum.c
@ -130,11 +130,10 @@ count_all_i(VALUE i, VALUE memop, int argc, VALUE *argv)
|
|||||||
* enum.count(item) -> int
|
* enum.count(item) -> int
|
||||||
* enum.count { |obj| block } -> int
|
* enum.count { |obj| block } -> int
|
||||||
*
|
*
|
||||||
* Returns the number of items in <i>enum</i> if it responds to a #size call,
|
* Returns the number of items in +enum+ through enumeration.
|
||||||
* otherwise the items are counted through enumeration. If an argument is
|
* If an argument is given, the number of items in +enum+ that
|
||||||
* given the number of items in <i>enum</i> that are equal to <i>item</i> are
|
* are equal to +item+ are counted. If a block is given, it
|
||||||
* counted. If a block is given, it counts the number of elements yielding a
|
* counts the number of elements yielding a true value.
|
||||||
* true value.
|
|
||||||
*
|
*
|
||||||
* ary = [1, 2, 4, 2]
|
* ary = [1, 2, 4, 2]
|
||||||
* ary.count #=> 4
|
* ary.count #=> 4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user