Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #351 from twitter/feature/add_default_option_setting
Browse files Browse the repository at this point in the history
ADd a means to set defaults outside the planner
  • Loading branch information
johnynek committed Nov 9, 2013
2 parents c7f45cf + deafca3 commit 67d4cdd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ object Scalding {

private def getOrElse[T: Manifest](options: Map[String, Options], idOpt: Option[String], default: T): T =
(for {
id <- idOpt
id <- idOpt.map(List(_, "DEFAULT")).getOrElse(List("DEFAULT"))
innerOpts <- options.get(id)
option <- innerOpts.get[T]
} yield option).getOrElse(default)
} yield option).headOption.getOrElse(default)

@annotation.tailrec
private def getFirst[T: Manifest](options: Map[String, Options], names: List[String]): Option[T] =
Expand Down

0 comments on commit 67d4cdd

Please sign in to comment.