summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-02 11:02:35 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-02 11:02:35 +0000
commit76991f51ec23309bf8ef2f6d06e5ba6e81f7a3f1 (patch)
treee1817e3afe1147b13463d9a1a7dae8e6dff609a6 /lib
parente8af2eb68e92907de8d6a1f8b437f71041a4ba01 (diff)
Improve rdoc for Enumerator#next. Remove a not-so-notable note.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/generator.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/generator.rb b/lib/generator.rb
index 2f4ceaa013..8285c0c33e 100644
--- a/lib/generator.rb
+++ b/lib/generator.rb
@@ -178,16 +178,12 @@ class Enumerator
# e.next => object
#
# Returns the next object in the enumerator, and move the internal
- # position forward. When the position reached at the end, internal
+ # position forward. When the position reaches at the end, internal
# position is rewound then StopIteration is raised.
#
- # Note that enumeration sequence by next method does not affect other
- # non-external enumeration methods, unless underlying iteration
- # methods itself has side-effect, e.g. IO#each_line.
- #
- # Caution: This feature internally uses Generator, which uses callcc
- # to stop and resume enumeration to fetch each value. Use with care
- # and be aware of the performance loss.
+ # Caution: This method is slow. It is implemented using the
+ # Generator library which uses callcc to stop and resume an "each"
+ # method to fetch values one by one.
def next
g = __generator
return g.next unless g.end?