Skip to content

Commit

Permalink
Removed funky (in a bad way) JArray extract semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
dchenbecker committed Nov 1, 2012
1 parent ca99d92 commit a59cc23
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -16,4 +16,4 @@ GTAGS
tags
nbproject
build.xml

TAGS
6 changes: 0 additions & 6 deletions json/src/main/scala/blueeyes/json/JValue.scala
Expand Up @@ -69,12 +69,6 @@ sealed trait JValue extends Merge.Mergeable with Diff.Diffable with Product with
*/
def \ (nameToFind: String): JValue = self match {
case j @ JObject(fields) => j.get(nameToFind)
case j @ JArray(elements) =>
elements.map(_ \ nameToFind) match {
case Nil => JUndefined
case x :: Nil => x
case elements @ x :: xs => JArray(elements)
}
case _ => JUndefined
}

Expand Down

0 comments on commit a59cc23

Please sign in to comment.