Skip to content

Commit

Permalink
Update array from extension
Browse files Browse the repository at this point in the history
  • Loading branch information
RustedBones committed Sep 5, 2024
1 parent f566425 commit e5c566e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,10 @@ private[compat] trait PackageShared {

class ArrayExtensions(private val fact: Array.type) extends AnyVal {
def from[A: ClassTag](source: TraversableOnce[A]): Array[A] =
fact.apply(source.toSeq: _*)
source match {
case it: Iterable[A] => it.toArray[A]
case _ => source.toIterator.toArray[A]
}
}

class ImmutableSortedMapExtensions(private val fact: i.SortedMap.type) extends AnyVal {
Expand Down

0 comments on commit e5c566e

Please sign in to comment.