Skip to content

Commit

Permalink
Don't transform to Chunk when using foreach in ZManaged (zio#4169)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostdogpr authored Sep 1, 2020
1 parent 63b430c commit ccf9638
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/shared/src/main/scala/zio/ZManaged.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ object ZManaged extends ZManagedPlatformSpecific {
case ExecutionStrategy.Sequential =>
(
ZIO
.foreach(Chunk.fromIterable(fins)) {
.foreach(fins: Iterable[(Long, Finalizer)]) {
case (_, fin) => fin.apply(exit).run
}
.flatMap(results => ZIO.done(Exit.collectAll(results) getOrElse Exit.unit)),
Expand All @@ -1347,7 +1347,7 @@ object ZManaged extends ZManagedPlatformSpecific {
case ExecutionStrategy.Parallel =>
(
ZIO
.foreachPar(Chunk.fromIterable(fins)) {
.foreachPar(fins: Iterable[(Long, Finalizer)]) {
case (_, finalizer) =>
finalizer(exit).run
}
Expand All @@ -1358,7 +1358,7 @@ object ZManaged extends ZManagedPlatformSpecific {
case ExecutionStrategy.ParallelN(n) =>
(
ZIO
.foreachParN(n)(Chunk.fromIterable(fins)) {
.foreachParN(n)(fins: Iterable[(Long, Finalizer)]) {
case (_, finalizer) =>
finalizer(exit).run
}
Expand Down

0 comments on commit ccf9638

Please sign in to comment.