Skip to content

Commit

Permalink
Remove unused imports
Browse files Browse the repository at this point in the history
- replace !.isEmpty with nonEmpty
- remove unnecessary parentheses
  • Loading branch information
dr0i committed Nov 6, 2023
1 parent 4cc55fc commit 991f8df
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/views/tags/result_short.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
@(id:String, doc: play.api.libs.json.JsValue, i: Int = -1, hits: Seq[String] = Seq())

@import play.api.libs.json._
@import views.TableRow
@import controllers.nwbib.Lobid
@import scala.collection.immutable.Map
@import play.mvc.Controller.session
@import play.cache.Cache
@import controllers.nwbib.Application

@optional(doc: JsValue, key: String, sep: String, alt: String)=@{
val other = (doc \\ key)
if(!other.isEmpty){
sep + other(0).asOpt[String].getOrElse(other(0).as[Seq[JsValue]].map(_.as[String]).mkString("; "))
val other = doc \\ key
if(other.nonEmpty){
sep + other.head.asOpt[String].getOrElse(other.head.as[Seq[JsValue]].map(_.as[String]).mkString("; "))
} else {alt}
}

Expand Down

0 comments on commit 991f8df

Please sign in to comment.