Skip to content

Commit 2158f90

Browse files
committed
Use IArray.map in Tuple.fromIArray
1 parent adfe16c commit 2158f90

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

library/src/scala/Tuple.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,18 +228,17 @@ object Tuple {
228228
case xs: Array[Object] => xs
229229
case xs => xs.map(_.asInstanceOf[Object])
230230
}
231-
runtime.Tuples.fromArray(xs2).asInstanceOf[Tuple]
231+
runtime.Tuples.fromArray(xs2)
232232
}
233233

234234
/** Convert an immutable array into a tuple of unknown arity and types */
235235
def fromIArray[T](xs: IArray[T]): Tuple = {
236236
val xs2: IArray[Object] = xs match {
237237
case xs: IArray[Object] @unchecked => xs
238238
case xs =>
239-
// TODO support IArray.map
240-
xs.asInstanceOf[Array[T]].map(_.asInstanceOf[Object]).asInstanceOf[IArray[Object]]
239+
xs.asInstanceOf[IArray[T]].map(_.asInstanceOf[Object])
241240
}
242-
runtime.Tuples.fromIArray(xs2).asInstanceOf[Tuple]
241+
runtime.Tuples.fromIArray(xs2)
243242
}
244243

245244
/** Convert a Product into a tuple of unknown arity and types */

0 commit comments

Comments
 (0)