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

ADd a means to set defaults outside the planner #351

Merged
merged 1 commit into from
Nov 9, 2013
Merged
Changes from all commits
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
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