diff --git a/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala b/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala index b379635cd9..c285bac0d9 100644 --- a/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala +++ b/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala @@ -231,20 +231,7 @@ final class Source[+Out, +Mat]( @deprecated("Use `Source.combine` on companion object instead", "2.5.5") def combine[T, U](first: Source[T, _], second: Source[T, _], rest: Source[T, _]*)( strategy: Int => Graph[UniformFanInShape[T, U], NotUsed]): Source[U, NotUsed] = - Source.fromGraph(GraphDSL.create() { implicit b => - import GraphDSL.Implicits._ - val c = b.add(strategy(rest.size + 2)) - first ~> c.in(0) - second ~> c.in(1) - - @tailrec def combineRest(idx: Int, i: Iterator[Source[T, _]]): SourceShape[U] = - if (i.hasNext) { - i.next() ~> c.in(idx) - combineRest(idx + 1, i) - } else SourceShape(c.out) - - combineRest(2, rest.iterator) - }) + Source.combine(first, second, rest: _*)(strategy) /** * Transform this source whose element is ``e`` into a source producing tuple ``(e, f(e))``