summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/immutable/TreeSet.scala
diff options
context:
space:
mode:
authorJames Iry <jamesiry@gmail.com>2013-02-11 12:55:06 -0800
committerJames Iry <jamesiry@gmail.com>2013-02-13 08:19:41 -0800
commit62bc99d3b20a7b37a977b19a6202cdac474eb5f6 (patch)
tree60a21fcd7332f515fa6dcb8c9735208edca828fc /src/library/scala/collection/immutable/TreeSet.scala
parenta0b1db4ce72e2f449de9ce2da2b6b0958bc33579 (diff)
downloadscala-62bc99d3b20a7b37a977b19a6202cdac474eb5f6.tar.gz
scala-62bc99d3b20a7b37a977b19a6202cdac474eb5f6.tar.bz2
scala-62bc99d3b20a7b37a977b19a6202cdac474eb5f6.zip
SI-6642 Adds iteratorFrom, keysIteratorFrom, and valuesIteratorFrom
Adds the ability to efficiently create an iterator that starts at a given key or element of a sorted set or map. Similar work is done for key and value only iterators on maps. The bulk of the work is in RedBlackTree. Most of the rest is pushing the new api methods throughout the appropriate spots in the collection API. This commit leaves undone some similar work possible on mutable TreeSets
Diffstat (limited to 'src/library/scala/collection/immutable/TreeSet.scala')
-rw-r--r--src/library/scala/collection/immutable/TreeSet.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/library/scala/collection/immutable/TreeSet.scala b/src/library/scala/collection/immutable/TreeSet.scala
index 8bceb936aa..67668b3bef 100644
--- a/src/library/scala/collection/immutable/TreeSet.scala
+++ b/src/library/scala/collection/immutable/TreeSet.scala
@@ -144,6 +144,7 @@ class TreeSet[A] private (tree: RB.Tree[A, Unit])(implicit val ordering: Orderin
* @return the new iterator
*/
def iterator: Iterator[A] = RB.keysIterator(tree)
+ override def keysIteratorFrom(start: A): Iterator[A] = RB.keysIterator(tree, Some(start))
override def foreach[U](f: A => U) = RB.foreachKey(tree, f)