@@ -53,7 +53,7 @@ trait EfficientSubstep {}
5353
5454/** Provides functionality for Stepper while keeping track of a more precise type of the collection.
5555 */
56- trait StepperLike [@ specialized(Double , Int , Long ) A , + CC ] { self =>
56+ trait StepperLike [@ specialized(Double , Int , Long ) A , + CC ] { self : CC =>
5757 /** Characteristics are bit flags that indicate runtime characteristics of this Stepper.
5858 *
5959 * - `Distinct` means that no duplicates exist
@@ -90,9 +90,6 @@ trait StepperLike[@specialized(Double, Int, Long) A, +CC] { self =>
9090 */
9191 def substep (): CC
9292
93- /** Returns the precise underlying type of this `Stepper`. */
94- def typedPrecisely : CC
95-
9693 /** Warns this `Stepper` that it is likely to be used in a parallel context (used for efficiency only) */
9794 def anticipateParallelism : this .type = this
9895
@@ -236,8 +233,7 @@ trait AnyStepper[A] extends Stepper[A] with java.util.Iterator[A] with Spliterat
236233 def nextStep = next
237234 def tryAdvance (c : java.util.function.Consumer [_ >: A ]): Boolean = if (hasNext) { c.accept(next); true } else false
238235 def tryStep (f : A => Unit ): Boolean = if (hasNext) { f(next); true } else false
239- def trySplit () = substep match { case null => null ; case x => x.typedPrecisely }
240- final def typedPrecisely : AnyStepper [A ] = this
236+ def trySplit () = substep
241237 override def spliterator : Spliterator [A ] = this
242238 def seqStream : java.util.stream.Stream [A ] = java.util.stream.StreamSupport .stream(this , false )
243239 def parStream : java.util.stream.Stream [A ] = java.util.stream.StreamSupport .stream(this , true )
@@ -253,8 +249,7 @@ trait DoubleStepper extends Stepper[Double] with java.util.PrimitiveIterator.OfD
253249 def tryAdvance (c : java.util.function.Consumer [_ >: java.lang.Double ]): Boolean = if (hasNext) { c.accept(java.lang.Double .valueOf(nextDouble)); true } else false
254250 def tryAdvance (c : java.util.function.DoubleConsumer ): Boolean = if (hasNext) { c.accept(nextDouble); true } else false
255251 def tryStep (f : Double => Unit ): Boolean = if (hasNext) { f(nextDouble); true } else false
256- def trySplit () = substep match { case null => null ; case x => x.typedPrecisely }
257- final def typedPrecisely : DoubleStepper = this
252+ def trySplit () = substep
258253 override def spliterator : Spliterator [Double ] = this .asInstanceOf [Spliterator [Double ]] // Scala and Java disagree about whether it's java.lang.Double or double
259254 def seqStream : java.util.stream.DoubleStream = java.util.stream.StreamSupport .doubleStream(this , false )
260255 def parStream : java.util.stream.DoubleStream = java.util.stream.StreamSupport .doubleStream(this , true )
@@ -270,8 +265,7 @@ trait IntStepper extends Stepper[Int] with java.util.PrimitiveIterator.OfInt wit
270265 def tryAdvance (c : java.util.function.Consumer [_ >: java.lang.Integer ]): Boolean = if (hasNext) { c.accept(java.lang.Integer .valueOf(nextInt)); true } else false
271266 def tryAdvance (c : java.util.function.IntConsumer ): Boolean = if (hasNext) { c.accept(nextInt); true } else false
272267 def tryStep (f : Int => Unit ): Boolean = if (hasNext) { f(nextInt); true } else false
273- def trySplit () = substep match { case null => null ; case x => x.typedPrecisely }
274- final def typedPrecisely = this
268+ def trySplit () = substep
275269 override def spliterator : Spliterator [Int ] = this .asInstanceOf [Spliterator [Int ]] // Scala and Java disagree about whether it's java.lang.Integer or int
276270 def seqStream : java.util.stream.IntStream = java.util.stream.StreamSupport .intStream(this , false )
277271 def parStream : java.util.stream.IntStream = java.util.stream.StreamSupport .intStream(this , true )
@@ -287,8 +281,7 @@ trait LongStepper extends Stepper[Long] with java.util.PrimitiveIterator.OfLong
287281 def tryAdvance (c : java.util.function.Consumer [_ >: java.lang.Long ]): Boolean = if (hasNext) { c.accept(java.lang.Long .valueOf(nextLong)); true } else false
288282 def tryAdvance (c : java.util.function.LongConsumer ): Boolean = if (hasNext) { c.accept(nextLong); true } else false
289283 def tryStep (f : Long => Unit ): Boolean = if (hasNext) { f(nextLong); true } else false
290- def trySplit () = substep match { case null => null ; case x => x.typedPrecisely }
291- final def typedPrecisely = this
284+ def trySplit () = substep
292285 override def spliterator : Spliterator [Long ] = this .asInstanceOf [Spliterator [Long ]] // Scala and Java disagree about whether it's java.lang.Long or long
293286 def seqStream : java.util.stream.LongStream = java.util.stream.StreamSupport .longStream(this , false )
294287 def parStream : java.util.stream.LongStream = java.util.stream.StreamSupport .longStream(this , true )
0 commit comments