Skip to content

Instantly share code, notes, and snippets.

@daneko
Forked from rirakkumya/refactor.scala
Created May 16, 2012 05:05
Show Gist options
  • Save daneko/2707601 to your computer and use it in GitHub Desktop.
Save daneko/2707601 to your computer and use it in GitHub Desktop.
def index(id:String) = Action {
getFirstData(id)
}
private def getFirstData(id:String) = {
Cache.get(id) match {
case Some(id2) => getSecondData(id2)
case None => NotFound
}
}
private def getSecondData(id2:String) = {
Cache.get(id2) match {
case Some(result) => Ok(result)
case None => NotFound
}
}
def index(id:String) = Action {
Cache.get(id) match {
case Some(id2) => {
Cache.get(id2) match {
case Some(result) => Ok(result)
case None => NotFound
}
}
case None => NotFound
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment