diff options
author | mihaylov <mihaylov@epfl.ch> | 2005-05-14 21:48:48 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2005-05-14 21:48:48 +0000 |
commit | c718a6bce618cb8b5aad367d23ecedd84ab49623 (patch) | |
tree | 7cd121eb98b425c81289737021dd986dca4a3815 | |
parent | 91a11635ebce7c462364cc8d067d49db2497d3e8 (diff) | |
download | scala-c718a6bce618cb8b5aad367d23ecedd84ab49623.tar.gz scala-c718a6bce618cb8b5aad367d23ecedd84ab49623.tar.bz2 scala-c718a6bce618cb8b5aad367d23ecedd84ab49623.zip |
Fixed the initial value of hasNext of Iterator....
Fixed the initial value of hasNext of Iterator.single()
-rw-r--r-- | sources/scala/Iterator.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/scala/Iterator.scala b/sources/scala/Iterator.scala index d37b19e7d7..205ca354e9 100644 --- a/sources/scala/Iterator.scala +++ b/sources/scala/Iterator.scala @@ -26,7 +26,7 @@ object Iterator { } def single[a](x: a) = new Iterator[a] { - private var hasnext = false; + private var hasnext = true; def hasNext: Boolean = hasnext; def next: a = if (hasnext) { hasnext = false; x } else Predef.error("next on empty iterator"); } |