Created
December 15, 2015 04:53
-
-
Save momota10/677d0a991d301eb24aae to your computer and use it in GitHub Desktop.
mutableなlistをfilteringする
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def execute(list: Seq[Int] ) = { | |
for(data <- list) yield cRepository.findById(data) map { | |
case Some(ca) => ca.status match { | |
case Stopped => list filterNot (_ == ca.id.get) | |
case _ => list | |
} | |
case None => list | |
} | |
Future.successful(list) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment