=str Make Source.range simpler. (#31551)

This commit is contained in:
kerr 2022-09-06 16:17:27 +08:00 committed by GitHub
parent aa9968a71b
commit 12ecd42989
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -175,10 +175,7 @@ object Source {
* @see [[scala.collection.immutable.Range.inclusive(Int, Int, Int)]]
*/
def range(start: Int, end: Int, step: Int): javadsl.Source[Integer, NotUsed] =
fromIterator[Integer](new function.Creator[util.Iterator[Integer]]() {
def create(): util.Iterator[Integer] =
Range.inclusive(start, end, step).iterator.asJava.asInstanceOf[util.Iterator[Integer]]
})
new Source(scaladsl.Source(Range.inclusive(start, end, step).asInstanceOf[immutable.Iterable[Integer]]))
/**
* Start a new `Source` from the given `Future`. The stream will consist of