=str - fixing TODO about scaladsl & javadsl Source/Sink/Flow/BidiFlow.wrap not having to needlessly re-wrap
This commit is contained in:
parent
8527e0347e
commit
3bf1c14b3a
8 changed files with 41 additions and 9 deletions
|
|
@ -202,8 +202,10 @@ object Source extends SourceApply {
|
|||
* A graph with the shape of a source logically is a source, this method makes
|
||||
* it so also in type.
|
||||
*/
|
||||
// TODO optimize if no wrapping needed
|
||||
def wrap[T, M](g: Graph[SourceShape[T], M]): Source[T, M] = new Source(g.module)
|
||||
def wrap[T, M](g: Graph[SourceShape[T], M]): Source[T, M] = g match {
|
||||
case s: Source[T, M] ⇒ s
|
||||
case other ⇒ new Source(other.module)
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to create [[Source]] from `Iterable`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue