From 19d49a976236634f489a03064872afac12084368 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 12 Jan 2014 17:43:31 -0500 Subject: [PATCH] remove unnecessary exec ctx prep from Iteratee.flatMap commit 2b276d24 implemented the lines: ``` case Step.Done(a, Input.Empty) => executeIteratee(f(a))(ec /* still on same thread; let executeIteratee do preparation */ ) case Step.Done(a, e) => executeIteratee(f(a))(ec.prepare /* still on same thread; let executeIteratee do preparation */ ).pureFlatFold { ``` However, the `ec.prepare` is incongruous with the adjacent comment, and the preparation is definitely not required as the preparation is indeed handled by `executeIteratee`. --- .../src/main/scala/play/api/libs/iteratee/Iteratee.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/iteratees/src/main/scala/play/api/libs/iteratee/Iteratee.scala b/framework/src/iteratees/src/main/scala/play/api/libs/iteratee/Iteratee.scala index 91cce6d6298..818c9d1a25e 100644 --- a/framework/src/iteratees/src/main/scala/play/api/libs/iteratee/Iteratee.scala +++ b/framework/src/iteratees/src/main/scala/play/api/libs/iteratee/Iteratee.scala @@ -491,7 +491,7 @@ trait Iteratee[E, +A] { def flatMap[B](f: A => Iteratee[E, B])(implicit ec: ExecutionContext): Iteratee[E, B] = { self.pureFlatFoldNoEC { // safe: folder either yields value immediately or executes with another EC case Step.Done(a, Input.Empty) => executeIteratee(f(a))(ec /* still on same thread; let executeIteratee do preparation */ ) - case Step.Done(a, e) => executeIteratee(f(a))(ec.prepare /* still on same thread; let executeIteratee do preparation */ ).pureFlatFold { + case Step.Done(a, e) => executeIteratee(f(a))(ec /* still on same thread; let executeIteratee do preparation */ ).pureFlatFold { case Step.Done(a, _) => Done(a, e) case Step.Cont(k) => k(e) case Step.Error(msg, e) => Error(msg, e)