Skip to content

Commit

Permalink
chore: Clean up some duplicated code.
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Matthew de Detrich <[email protected]>
  • Loading branch information
He-Pin and mdedetrich authored Jan 20, 2024
1 parent b1ec854 commit 637d72a
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,8 @@ import pekko.util.ccompat._
} catch {
case NonFatal(ex) =>
decider(ex) match {
case Supervision.Stop => failStage(ex)
case Supervision.Resume => if (!hasBeenPulled(in)) pull(in)
case Supervision.Restart => if (!hasBeenPulled(in)) pull(in)
case Supervision.Stop => failStage(ex)
case _ => pull(in)
}
}

Expand Down Expand Up @@ -267,9 +266,12 @@ private[stream] object Collect {
} catch {
case NonFatal(ex) =>
decider(ex) match {
case Supervision.Stop => failStage(ex)
case Supervision.Resume => if (!hasBeenPulled(in)) pull(in)
case Supervision.Restart => if (!hasBeenPulled(in)) pull(in)
case Supervision.Stop => failStage(ex)
case _ =>
// The !hasBeenPulled(in) check is not required here since it
// isn't possible to do an additional pull(in) due to the nature
// of how collect works
pull(in)
}
}

Expand Down

0 comments on commit 637d72a

Please sign in to comment.