Skip to content

Commit 14bbae8

Browse files
committed
Use IArray.apply and state where operations are missing on IArray
1 parent 3d827b4 commit 14bbae8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

library/src/scala/TupleXXL.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ final class TupleXXL private (es: IArray[Object]) extends Product {
2222

2323
def tailXXL: TupleXXL = {
2424
assert(es.length > 23)
25-
new TupleXXL(es.asInstanceOf[Array[Object]].tail.asInstanceOf[IArray[Object]])
25+
new TupleXXL(es.asInstanceOf[Array[Object]].tail.asInstanceOf[IArray[Object]]) // TODO use IArray.tail
2626
}
2727

28-
def toArray: Array[Object] = es.asInstanceOf[Array[Object]].clone
28+
def toArray: Array[Object] = es.asInstanceOf[Array[Object]].clone // TODO use IArray.toArray
2929
}
3030
object TupleXXL {
31-
def fromIterator(elems: Iterator[Any]) = new TupleXXL(elems.map(_.asInstanceOf[Object]).toArray.asInstanceOf[IArray[Object]])
31+
def fromIterator(elems: Iterator[Any]) = new TupleXXL(elems.map(_.asInstanceOf[Object]).toArray.asInstanceOf[IArray[Object]]) // TODO use Iterator.toIArray
3232
def fromIArray(elems: IArray[Object]) = new TupleXXL(elems)
33-
def apply(elems: Any*) = new TupleXXL(elems.asInstanceOf[Seq[Object]].toArray.asInstanceOf[IArray[Object]])
34-
def unapplySeq(x: TupleXXL): Option[Seq[Any]] = Some(x.elems.asInstanceOf[Array[Object]].toSeq)
33+
def apply(elems: Any*) = new TupleXXL(IArray(elems.asInstanceOf[Seq[AnyRef]]: _*))
34+
def unapplySeq(x: TupleXXL): Option[Seq[Any]] = Some(x.elems.asInstanceOf[Array[Object]].toSeq) // TODO use IArray.toSeq
3535
}

library/src/scala/runtime/DynamicTuple.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ object DynamicTuple {
173173
case _ =>
174174
xs match {
175175
case xs: TupleXXL => xs
176-
case xs => TupleXXL.fromIArray(xs.productIterator.map(_.asInstanceOf[Object]).toArray.asInstanceOf[IArray[Object]])
176+
case xs => TupleXXL.fromIArray(xs.productIterator.map(_.asInstanceOf[Object]).toArray.asInstanceOf[IArray[Object]]) // TODO use Iterator.toIArray
177177
}
178178
}).asInstanceOf[T]
179179

0 commit comments

Comments
 (0)