Skip to content

Instantly share code, notes, and snippets.

@momota10
Created December 15, 2015 04:53
Show Gist options
  • Save momota10/677d0a991d301eb24aae to your computer and use it in GitHub Desktop.
Save momota10/677d0a991d301eb24aae to your computer and use it in GitHub Desktop.
mutableなlistをfilteringする
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