summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2005-05-14 21:48:48 +0000
committermihaylov <mihaylov@epfl.ch>2005-05-14 21:48:48 +0000
commitc718a6bce618cb8b5aad367d23ecedd84ab49623 (patch)
tree7cd121eb98b425c81289737021dd986dca4a3815
parent91a11635ebce7c462364cc8d067d49db2497d3e8 (diff)
downloadscala-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.scala2
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");
}