Skip to content

Commit 334af17

Browse files
committed
Short circuit &&
1 parent 0639d28 commit 334af17

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/src-3.x/scala/internal/quoted/Matcher.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ object Matcher {
342342
def (self: Matching) asOptionOfTuple: Option[Tuple] = self
343343

344344
/** Concatenates the contents of two sucessful matchings or return a `notMatched` */
345-
def (self: Matching) && (that: Matching): Matching = self match {
345+
// FIXME inline to avoid alocation of by name closure (see #6395)
346+
/*inline*/ def (self: Matching) && (that: => Matching): Matching = self match {
346347
case Some(x) =>
347348
that match {
348349
case Some(y) => Some(x ++ y)

0 commit comments

Comments
 (0)