Skip to content

Commit 46c0540

Browse files
committed
Cleanup imports
1 parent 9039341 commit 46c0540

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

library/src/scala/IArray.scala

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package scala
22
import reflect.ClassTag
33

4-
import scala.collection._
4+
import scala.collection.{LazyZip2, SeqView, Searching, Stepper, StepperShape}
5+
import scala.collection.immutable.ArraySeq
56
import scala.collection.mutable.IArrayBuilder
67

78
opaque type IArray[+T] = Array[_ <: T]
@@ -276,8 +277,8 @@ object IArray:
276277
def startsWith[U >: T](that: IterableOnce[U], offset: Int): Boolean = genericArrayOps(arr).startsWith(that, offset)
277278
def endsWith[U >: T](that: IArray[U]): Boolean = genericArrayOps(arr).endsWith(that)
278279
def endsWith[U >: T](that: Iterable[U]): Boolean = genericArrayOps(arr).endsWith(that)
279-
def groupBy[K](f: T => K): immutable.Map[K, IArray[T]] = genericArrayOps(arr).groupBy(f)
280-
def groupMap[K, U: ClassTag](key: T => K)(f: T => U): immutable.Map[K, IArray[U]] = genericArrayOps(arr).groupMap(key)(f)
280+
def groupBy[K](f: T => K): Map[K, IArray[T]] = genericArrayOps(arr).groupBy(f)
281+
def groupMap[K, U: ClassTag](key: T => K)(f: T => U): Map[K, IArray[U]] = genericArrayOps(arr).groupMap(key)(f)
281282
def grouped(size: Int): Iterator[IArray[T]] = genericArrayOps(arr).grouped(size)
282283
def inits: Iterator[IArray[T]] = genericArrayOps(arr).inits
283284
def intersect[U >: T](that: IArray[U]): IArray[T] = genericArrayOps(arr).intersect(that)
@@ -326,53 +327,53 @@ object IArray:
326327
def +:(arr: IArray[U]): IArray[U] = genericArrayOps(arr).prepended(x)
327328

328329
/** Conversion from IArray to immutable.ArraySeq */
329-
implicit def genericWrapArray[T](arr: IArray[T]): immutable.ArraySeq[T] =
330-
if arr eq null then null else immutable.ArraySeq.unsafeWrapArray(arr)
330+
implicit def genericWrapArray[T](arr: IArray[T]): ArraySeq[T] =
331+
if arr eq null then null else ArraySeq.unsafeWrapArray(arr)
331332

332333
/** Conversion from IArray to immutable.ArraySeq */
333-
implicit def wrapRefArray[T <: AnyRef](arr: IArray[T]): immutable.ArraySeq.ofRef[T] =
334+
implicit def wrapRefArray[T <: AnyRef](arr: IArray[T]): ArraySeq.ofRef[T] =
334335
// Since the JVM thinks arrays are covariant, one 0-length Array[AnyRef]
335336
// is as good as another for all T <: AnyRef. Instead of creating 100,000,000
336337
// unique ones by way of this implicit, let's share one.
337338
if (arr eq null) null
338-
else if (arr.length == 0) immutable.ArraySeq.empty[AnyRef].asInstanceOf[immutable.ArraySeq.ofRef[T]]
339-
else immutable.ArraySeq.ofRef(arr.asInstanceOf[Array[T]])
339+
else if (arr.length == 0) ArraySeq.empty[AnyRef].asInstanceOf[ArraySeq.ofRef[T]]
340+
else ArraySeq.ofRef(arr.asInstanceOf[Array[T]])
340341

341342
/** Conversion from IArray to immutable.ArraySeq */
342-
implicit def wrapIntArray(arr: IArray[Int]): immutable.ArraySeq.ofInt =
343-
if (arr ne null) new immutable.ArraySeq.ofInt(arr.asInstanceOf[Array[Int]]) else null
343+
implicit def wrapIntArray(arr: IArray[Int]): ArraySeq.ofInt =
344+
if (arr ne null) new ArraySeq.ofInt(arr.asInstanceOf[Array[Int]]) else null
344345

345346
/** Conversion from IArray to immutable.ArraySeq */
346-
implicit def wrapDoubleIArray(arr: IArray[Double]): immutable.ArraySeq.ofDouble =
347-
if (arr ne null) new immutable.ArraySeq.ofDouble(arr.asInstanceOf[Array[Double]]) else null
347+
implicit def wrapDoubleIArray(arr: IArray[Double]): ArraySeq.ofDouble =
348+
if (arr ne null) new ArraySeq.ofDouble(arr.asInstanceOf[Array[Double]]) else null
348349

349350
/** Conversion from IArray to immutable.ArraySeq */
350-
implicit def wrapLongIArray(arr: IArray[Long]): immutable.ArraySeq.ofLong =
351-
if (arr ne null) new immutable.ArraySeq.ofLong(arr.asInstanceOf[Array[Long]]) else null
351+
implicit def wrapLongIArray(arr: IArray[Long]): ArraySeq.ofLong =
352+
if (arr ne null) new ArraySeq.ofLong(arr.asInstanceOf[Array[Long]]) else null
352353

353354
/** Conversion from IArray to immutable.ArraySeq */
354-
implicit def wrapFloatIArray(arr: IArray[Float]): immutable.ArraySeq.ofFloat =
355-
if (arr ne null) new immutable.ArraySeq.ofFloat(arr.asInstanceOf[Array[Float]]) else null
355+
implicit def wrapFloatIArray(arr: IArray[Float]): ArraySeq.ofFloat =
356+
if (arr ne null) new ArraySeq.ofFloat(arr.asInstanceOf[Array[Float]]) else null
356357

357358
/** Conversion from IArray to immutable.ArraySeq */
358-
implicit def wrapCharIArray(arr: IArray[Char]): immutable.ArraySeq.ofChar =
359-
if (arr ne null) new immutable.ArraySeq.ofChar(arr.asInstanceOf[Array[Char]]) else null
359+
implicit def wrapCharIArray(arr: IArray[Char]): ArraySeq.ofChar =
360+
if (arr ne null) new ArraySeq.ofChar(arr.asInstanceOf[Array[Char]]) else null
360361

361362
/** Conversion from IArray to immutable.ArraySeq */
362-
implicit def wrapByteIArray(arr: IArray[Byte]): immutable.ArraySeq.ofByte =
363-
if (arr ne null) new immutable.ArraySeq.ofByte(arr.asInstanceOf[Array[Byte]]) else null
363+
implicit def wrapByteIArray(arr: IArray[Byte]): ArraySeq.ofByte =
364+
if (arr ne null) new ArraySeq.ofByte(arr.asInstanceOf[Array[Byte]]) else null
364365

365366
/** Conversion from IArray to immutable.ArraySeq */
366-
implicit def wrapShortIArray(arr: IArray[Short]): immutable.ArraySeq.ofShort =
367-
if (arr ne null) new immutable.ArraySeq.ofShort(arr.asInstanceOf[Array[Short]]) else null
367+
implicit def wrapShortIArray(arr: IArray[Short]): ArraySeq.ofShort =
368+
if (arr ne null) new ArraySeq.ofShort(arr.asInstanceOf[Array[Short]]) else null
368369

369370
/** Conversion from IArray to immutable.ArraySeq */
370-
implicit def wrapBooleanIArray(arr: IArray[Boolean]): immutable.ArraySeq.ofBoolean =
371-
if (arr ne null) new immutable.ArraySeq.ofBoolean(arr.asInstanceOf[Array[Boolean]]) else null
371+
implicit def wrapBooleanIArray(arr: IArray[Boolean]): ArraySeq.ofBoolean =
372+
if (arr ne null) new ArraySeq.ofBoolean(arr.asInstanceOf[Array[Boolean]]) else null
372373

373374
/** Conversion from IArray to immutable.ArraySeq */
374-
implicit def wrapUnitIArray(arr: IArray[Unit]): immutable.ArraySeq.ofUnit =
375-
if (arr ne null) new immutable.ArraySeq.ofUnit(arr.asInstanceOf[Array[Unit]]) else null
375+
implicit def wrapUnitIArray(arr: IArray[Unit]): ArraySeq.ofUnit =
376+
if (arr ne null) new ArraySeq.ofUnit(arr.asInstanceOf[Array[Unit]]) else null
376377

377378
/** Convert an array into an immutable array without copying, the original array
378379
* must _not_ be mutated after this or the guaranteed immutablity of IArray will
@@ -451,7 +452,7 @@ object IArray:
451452
// `Array.concat` should arguably take in a `Seq[Array[_ <: T]]`,
452453
// but since it currently takes a `Seq[Array[T]]` we have to perform a cast,
453454
// knowing tacitly that `concat` is not going to do the wrong thing.
454-
Array.concat[T](xss.asInstanceOf[immutable.Seq[Array[T]]]: _*)
455+
Array.concat[T](xss.asInstanceOf[Seq[Array[T]]]: _*)
455456

456457
/** Returns an immutable array that contains the results of some element computation a number
457458
* of times. Each element is determined by a separate computation.

0 commit comments

Comments
 (0)