tuned;
authorwenzelm
Sun, 22 Aug 2010 22:09:14 +0200
changeset 38583 ff7f9510b0d6
parent 38582 3a6ce43d99b1
child 38584 9f63135f3cbb
tuned;
src/Pure/General/linear_set.scala
src/Pure/library.scala
--- a/src/Pure/General/linear_set.scala	Sun Aug 22 20:25:15 2010 +0200
+++ b/src/Pure/General/linear_set.scala	Sun Aug 22 22:09:14 2010 +0200
@@ -143,13 +143,13 @@
 
   private def make_iterator(start: Option[A], which: Map[A, A]): Iterator[A] = new Iterator[A] {
     private var next_elem = start
-    def hasNext = next_elem.isDefined
-    def next =
+    def hasNext(): Boolean = next_elem.isDefined
+    def next(): A =
       next_elem match {
         case Some(elem) =>
           next_elem = which.get(elem)
           elem
-        case None => throw new NoSuchElementException("next on empty iterator")
+        case None => Iterator.empty.next()
       }
   }
 
--- a/src/Pure/library.scala	Sun Aug 22 20:25:15 2010 +0200
+++ b/src/Pure/library.scala	Sun Aug 22 22:09:14 2010 +0200
@@ -79,7 +79,7 @@
     def next(): CharSequence =
       state match {
         case Some((s, i)) => { state = next_chunk(i); s }
-        case None => throw new NoSuchElementException("next on empty iterator")
+        case None => Iterator.empty.next()
       }
   }