summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/mutable/IndexedSeqView.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/scala/collection/mutable/IndexedSeqView.scala')
-rw-r--r--src/library/scala/collection/mutable/IndexedSeqView.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/collection/mutable/IndexedSeqView.scala b/src/library/scala/collection/mutable/IndexedSeqView.scala
index 31a4749960..7acdeeff18 100644
--- a/src/library/scala/collection/mutable/IndexedSeqView.scala
+++ b/src/library/scala/collection/mutable/IndexedSeqView.scala
@@ -50,7 +50,7 @@ self =>
trait Sliced extends super.Sliced with Transformed[A] {
override def length = endpoints.width
def update(idx: Int, elem: A) =
- if (idx + from < until) self.update(idx + from, elem)
+ if (idx >= 0 && idx + from < until) self.update(idx + from, elem)
else throw new IndexOutOfBoundsException(idx.toString)
}