Merge pull request #16471 from akka/wip-noclose-optimization-√
=str - Addresses so that the optimizer for collect does not close over t...
This commit is contained in:
commit
2fee14f7bb
1 changed files with 4 additions and 2 deletions
|
|
@ -275,7 +275,8 @@ case class ActorBasedFlowMaterializer(override val settings: MaterializerSetting
|
||||||
case noMatch if !optimizations.simplification || (noMatch ne orig) ⇒ orig
|
case noMatch if !optimizations.simplification || (noMatch ne orig) ⇒ orig
|
||||||
|
|
||||||
// Two consecutive maps is equivalent to one pipelined map
|
// Two consecutive maps is equivalent to one pipelined map
|
||||||
case (second: Ast.Map) :: (first: Ast.Map) :: rest ⇒ Ast.Map(first.f andThen second.f, first.attributes and second.attributes) :: rest
|
case Ast.Map(second, secondAttributes) :: Ast.Map(first, firstAttributes) :: rest ⇒
|
||||||
|
Ast.Map(first andThen second, firstAttributes and secondAttributes) :: rest
|
||||||
|
|
||||||
case noMatch ⇒ noMatch
|
case noMatch ⇒ noMatch
|
||||||
}
|
}
|
||||||
|
|
@ -286,7 +287,8 @@ case class ActorBasedFlowMaterializer(override val settings: MaterializerSetting
|
||||||
case noMatch if !optimizations.collapsing || (noMatch ne orig) ⇒ orig
|
case noMatch if !optimizations.collapsing || (noMatch ne orig) ⇒ orig
|
||||||
|
|
||||||
// Collapses a filter and a map into a collect
|
// Collapses a filter and a map into a collect
|
||||||
case (map: Ast.Map) :: (fil: Ast.Filter) :: rest ⇒ Ast.Collect({ case i if fil.p(i) ⇒ map.f(i) }) :: rest
|
case Ast.Map(mapFn, mapAttributes) :: Ast.Filter(filFn, filAttributes) :: rest ⇒
|
||||||
|
Ast.Collect({ case i if filFn(i) ⇒ mapFn(i) }, filAttributes and mapAttributes) :: rest
|
||||||
|
|
||||||
case noMatch ⇒ noMatch
|
case noMatch ⇒ noMatch
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue