diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-24 23:51:56 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-24 23:51:56 +0000 |
commit | 38f0dd0aba75a31008a698362e264ad894c10685 (patch) | |
tree | 995083440f4cfc603dcce9c35af3da4c5d8c21e0 /enum.c | |
parent | 80aaa3ef6c87a4cbb13c92097ee5170a663d4175 (diff) | |
download | ruby-38f0dd0aba75a31008a698362e264ad894c10685.tar.gz |
* 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
Diffstat (limited to 'enum.c')
-rw-r--r-- | enum.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -130,11 +130,10 @@ count_all_i(VALUE i, VALUE memop, int argc, VALUE *argv) * 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 |