diff options
author | Paul Phillips <paulp@improving.org> | 2011-01-29 18:35:53 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-01-29 18:35:53 +0000 |
commit | 80488e4218a0a72dec3ba727e6de276da87f1398 (patch) | |
tree | 74c0275dea23c90e2ba4c9558e8ff3c9bfb086a2 | |
parent | cf492f472aa6d1154cd7336c37bab0b78125b872 (diff) | |
download | scala-80488e4218a0a72dec3ba727e6de276da87f1398.tar.gz scala-80488e4218a0a72dec3ba727e6de276da87f1398.tar.bz2 scala-80488e4218a0a72dec3ba727e6de276da87f1398.zip |
Fixed bug in IndexedSeqOptimized.indexWhere suc...
Fixed bug in IndexedSeqOptimized.indexWhere such that the empty string
would find things all over the place. Closes #4197, no review.
-rwxr-xr-x | src/library/scala/collection/IndexedSeqOptimized.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/collection/IndexedSeqOptimized.scala b/src/library/scala/collection/IndexedSeqOptimized.scala index e95b6475de..0d95108235 100755 --- a/src/library/scala/collection/IndexedSeqOptimized.scala +++ b/src/library/scala/collection/IndexedSeqOptimized.scala @@ -190,7 +190,7 @@ trait IndexedSeqOptimized[+A, +Repr] extends IndexedSeqLike[A, Repr] { self => i - start } - private def negLength(n: Int) = if (n == length) -1 else n + private def negLength(n: Int) = if (n >= length) -1 else n override /*SeqLike*/ def indexWhere(p: A => Boolean, from: Int): Int = { |