Skip to content

Commit

Permalink
Router: optimization, check brace then matching
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Nov 27, 2024
1 parent c035ada commit ae2f6f5
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -887,11 +887,10 @@ class Router(formatOps: FormatOps) {
else getNoSplitAfterOpening(ft, commentNL = null)

def multilineSpaceSplit(implicit fileLine: FileLine): Split = {
val lambdaLeft: Option[FT] =
matchingOptLeft(functionExpire(lambda)._1) match {
case x @ Some(FT(_: T.LeftBrace, _, _)) => x
case _ => None
}
val lambdaLeft: Option[FT] = functionExpire(lambda)._1 match {
case x @ FT(_: T.RightBrace, _, _) => matchingOptLeft(x)
case _ => None
}

val arrowFt = getFuncArrow(lambda).get
val lambdaIsABlock = lambdaLeft.exists(_.left eq arrowFt.right)
Expand Down

0 comments on commit ae2f6f5

Please sign in to comment.