diff options
author | michelou <michelou@epfl.ch> | 2004-05-07 14:58:32 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2004-05-07 14:58:32 +0000 |
commit | 5fef5ac208be466ffb260bfee6c89835a07584da (patch) | |
tree | e8e8a863e67736c038ebbc9c6ce394764ca9b6f6 | |
parent | 9711cb5539092c237801a0e600957ae3934bb938 (diff) | |
download | scala-5fef5ac208be466ffb260bfee6c89835a07584da.tar.gz scala-5fef5ac208be466ffb260bfee6c89835a07584da.tar.bz2 scala-5fef5ac208be466ffb260bfee6c89835a07584da.zip |
- corrected wrong start value of function 'from'.
-rw-r--r-- | sources/scala/Iterator.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/scala/Iterator.scala b/sources/scala/Iterator.scala index d4e76939a9..3472f1f436 100644 --- a/sources/scala/Iterator.scala +++ b/sources/scala/Iterator.scala @@ -110,7 +110,7 @@ object Iterator { * @return the iterator starting at value <code>lo</code>. */ def from(lo: Int, step: Int) = new Iterator[Int] { - private var i = 0; + private var i = lo; def hasNext: Boolean = true; def next: Int = { val j = i; i = i + step; j } } @@ -124,7 +124,7 @@ object Iterator { * @return the iterator starting at value <code>lo</code>. */ def from(lo: Int, step: Int => Int) = new Iterator[Int] { - private var i = 0; + private var i = lo; def hasNext: Boolean = true; def next: Int = { val j = i; i = step(i); j } } |