diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-11-24 22:40:13 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-11-26 16:05:01 +0100 |
commit | f039ac8d61cc5ac43c7ea3683f60fe0a5ad15479 (patch) | |
tree | 0bec079923f54a718192665962d4dee22054f574 /src/main/scala | |
parent | 4518c96f9b54a1b7ca14d82b3ed31d7014a67f57 (diff) | |
download | scala-async-f039ac8d61cc5ac43c7ea3683f60fe0a5ad15479.tar.gz scala-async-f039ac8d61cc5ac43c7ea3683f60fe0a5ad15479.tar.bz2 scala-async-f039ac8d61cc5ac43c7ea3683f60fe0a5ad15479.zip |
Flatmap it, Sam.
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/scala/async/AnfTransform.scala | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/main/scala/scala/async/AnfTransform.scala b/src/main/scala/scala/async/AnfTransform.scala index f52bdad..64bde3e 100644 --- a/src/main/scala/scala/async/AnfTransform.scala +++ b/src/main/scala/scala/async/AnfTransform.scala @@ -139,10 +139,7 @@ private[async] final case class AnfTransform[C <: Context](c: C) { } } - def transformToList(trees: List[Tree]): List[Tree] = trees match { - case fst :: rest => transformToList(fst) ++ transformToList(rest) - case Nil => Nil - } + def transformToList(trees: List[Tree]): List[Tree] = trees flatMap transformToList def transformToBlock(tree: Tree): Block = transformToList(tree) match { case stats :+ expr => Block(stats, expr) |