diff options
author | Paul Phillips <paulp@improving.org> | 2009-10-19 18:11:00 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-10-19 18:11:00 +0000 |
commit | 6dae27f35a329c89df3432922cde6db680910392 (patch) | |
tree | fc9822b41760bb43f6fe524863fb4577e42155d9 | |
parent | d828ace341eba19d0e591e8c50e2dad2fb4acc37 (diff) | |
download | scala-6dae27f35a329c89df3432922cde6db680910392.tar.gz scala-6dae27f35a329c89df3432922cde6db680910392.tar.bz2 scala-6dae27f35a329c89df3432922cde6db680910392.zip |
Repaired some impressively wrong isEmpty logic ...
Repaired some impressively wrong isEmpty logic (ticket #2483.)
-rw-r--r-- | src/library/scala/collection/immutable/GenericRange.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scala/collection/immutable/GenericRange.scala b/src/library/scala/collection/immutable/GenericRange.scala index 9736817035..90779912c0 100644 --- a/src/library/scala/collection/immutable/GenericRange.scala +++ b/src/library/scala/collection/immutable/GenericRange.scala @@ -99,11 +99,11 @@ extends VectorView[T, collection.immutable.Vector[T]] def length: Int = toInt(genericLength) final override def isEmpty = if (step > zero) + if (isInclusive) end < start + else end <= start + else if (isInclusive) end > start else end >= start - else - if (isInclusive) start > end - else start >= end def apply(idx: Int): T = { if (idx < 0 || idx >= length) throw new IndexOutOfBoundsException(idx.toString) |