summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-22 19:26:04 +0000
committerPaul Phillips <paulp@improving.org>2011-01-22 19:26:04 +0000
commitda0d80743a2d799cbfbb00ada243f043fae3a759 (patch)
treed59eaa0599c092bb9b59d76487511973c915adfa /src/library
parent647d23d801a14a2bdd5e740325ef7d099aea15d7 (diff)
downloadscala-da0d80743a2d799cbfbb00ada243f043fae3a759.tar.gz
scala-da0d80743a2d799cbfbb00ada243f043fae3a759.tar.bz2
scala-da0d80743a2d799cbfbb00ada243f043fae3a759.zip
Incorporated feedback on a couple recent commits.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/collection/SetLike.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/library/scala/collection/SetLike.scala b/src/library/scala/collection/SetLike.scala
index 7990837685..71c12be778 100644
--- a/src/library/scala/collection/SetLike.scala
+++ b/src/library/scala/collection/SetLike.scala
@@ -212,12 +212,13 @@ self =>
def subsetOf(that: Set[A]) = this forall that
/** An iterator over all subsets of this set of the given size.
+ * If the requested size is impossible, an empty iterator is returned.
*
* @param len the size of the subsets.
* @return the iterator.
*/
def subsets(len: Int): Iterator[This] = {
- if (len < 0 || len > size) throw new IllegalArgumentException(len.toString)
+ if (len < 0 || len > size) Iterator.empty
else new SubsetsItr(self.toIndexedSeq, len)
}