Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
collape consecutive pattern matches into one
  • Loading branch information
knutwalker committed Jul 17, 2014
commit 5f7e1f6e277f902a4aea717e74c6704a46f4064d
7 changes: 3 additions & 4 deletions src/main/scala/com/redis/pipeline/AkkaStreamTransport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ trait AkkaStreamTransport { me: Actor =>
private def createPipe = context watch context.actorOf(TcpPipeProducer.props())

private def returnToSender(commanderAndResult: (ActorRef, Try[Any])): Unit = {
val (commander, result) = commanderAndResult
result match {
case Success(res) => commander ! res
case Failure(e) => commander ! Status.Failure(e)
commanderAndResult match {
case (commander, Success(res)) => commander ! res
case (commander, Failure(e)) => commander ! Status.Failure(e)
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commanderAndResult match {
  case (commander, Success(res)) => commander ! res
  case (commander, Failure(e)) => commander ! Status.Failure(e)
}

saves a bit


Expand Down