summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scalax/collection/generic/VectorTemplate.scala2
-rw-r--r--src/library/scalax/collection/generic/covartest/VectorTemplate.scala2
-rw-r--r--src/library/scalax/collection/mutable/ArrayBuffer.scala3
3 files changed, 4 insertions, 3 deletions
diff --git a/src/library/scalax/collection/generic/VectorTemplate.scala b/src/library/scalax/collection/generic/VectorTemplate.scala
index bc18ac45c2..cd3412498d 100644
--- a/src/library/scalax/collection/generic/VectorTemplate.scala
+++ b/src/library/scalax/collection/generic/VectorTemplate.scala
@@ -34,7 +34,7 @@ self =>
x
} else Iterator.empty.next
def head =
- self(i)
+ if (i < end) self(i) else Iterator.empty.next
/** drop is overridden to enable fast searching in the middle of random access sequences */
override def drop(n: Int): Iterator[A] =
if (n > 0) new Elements(start + n, end) else this
diff --git a/src/library/scalax/collection/generic/covartest/VectorTemplate.scala b/src/library/scalax/collection/generic/covartest/VectorTemplate.scala
index 6e44b6a6c5..474fb9ad7e 100644
--- a/src/library/scalax/collection/generic/covartest/VectorTemplate.scala
+++ b/src/library/scalax/collection/generic/covartest/VectorTemplate.scala
@@ -34,7 +34,7 @@ self =>
x
} else Iterator.empty.next
def head =
- self(i)
+ if (i < end) self(i) else Iterator.empty.next
/** drop is overridden to enable fast searching in the middle of random access sequences */
override def drop(n: Int): Iterator[A] =
if (n > 0) new Elements(start + n, end) else this
diff --git a/src/library/scalax/collection/mutable/ArrayBuffer.scala b/src/library/scalax/collection/mutable/ArrayBuffer.scala
index 3e4877cef7..634e002111 100644
--- a/src/library/scalax/collection/mutable/ArrayBuffer.scala
+++ b/src/library/scalax/collection/mutable/ArrayBuffer.scala
@@ -93,7 +93,8 @@ class ArrayBuffer[A] extends Buffer[A] with Builder[ArrayBuffer, A] with Resizab
/** Removes the element on a given index position. It takes time linear in
* the buffer size.
*
- * @param n the index which refers to the element to delete.
+ * @param n the index which refers to the first element to delete.
+ * @param count the number of elemenets to delete
* @return the updated array buffer.
* @throws Predef.IndexOutOfBoundsException if <code>n</code> is out of bounds.
*/