Skip to content

Commit

Permalink
Merge pull request #1510 from diesalbla/patch-1
Browse files Browse the repository at this point in the history
Replace a Option.fold with an Option.isEmpty
  • Loading branch information
mpilquist committed Jun 15, 2019
2 parents 34f3ce5 + d823418 commit 5e64fa4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/fs2/internal/Algebra.scala
Expand Up @@ -255,7 +255,7 @@ private[fs2] object Algebra {
case Right(Out(head, outScope, tail)) =>
// if we originally swapped scopes we want to return the original
// scope back to the go as that is the scope that is expected to be here.
val nextScope = u.scope.fold(outScope)(_ => scope)
val nextScope = if (u.scope.isEmpty) outScope else scope
interruptGuard(nextScope)(
go(nextScope, view.next(Result.pure(Some((head, outScope.id, tail)))))
)
Expand Down

0 comments on commit 5e64fa4

Please sign in to comment.