=str - Addresses so that the optimizer for collect does not close over the previous AstNodes
This commit is contained in:
parent
bd3ee6b54f
commit
15f1e7cfd9
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
|
||||
|
||||
// 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
|
||||
}
|
||||
|
|
@ -286,7 +287,8 @@ case class ActorBasedFlowMaterializer(override val settings: MaterializerSetting
|
|||
case noMatch if !optimizations.collapsing || (noMatch ne orig) ⇒ orig
|
||||
|
||||
// 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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue