We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f566425 commit 0208593Copy full SHA for 0208593
compat/src/main/scala-2.11_2.12/scala/collection/compat/PackageShared.scala
@@ -362,7 +362,10 @@ private[compat] trait PackageShared {
362
363
class ArrayExtensions(private val fact: Array.type) extends AnyVal {
364
def from[A: ClassTag](source: TraversableOnce[A]): Array[A] =
365
- fact.apply(source.toSeq: _*)
+ source match {
366
+ case it: Iterable[A] => it.toArray[A]
367
+ case _ => source.toIterator.toArray[A]
368
+ }
369
}
370
371
class ImmutableSortedMapExtensions(private val fact: i.SortedMap.type) extends AnyVal {
0 commit comments