Skip to content

Commit 3f07fb9

Browse files
committed
Streamline a collection operation
1 parent 2414033 commit 3f07fb9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,9 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
574574

575575
/** Map first halfs of opaqueProxies pairs to second halfs, using =:= as equality */
576576
def mapRef(ref: TermRef): Option[TermRef] =
577-
opaqueProxies
578-
.find((from, to) => from.symbol == ref.symbol && from =:= ref)
579-
.map(_._2)
577+
opaqueProxies.collectFirst {
578+
case (from, to) if from.symbol == ref.symbol && from =:= ref => to
579+
}
580580

581581
/** If `binding` contains TermRefs that refer to objects with opaque
582582
* type aliases, add proxy definitions that expose these aliases

0 commit comments

Comments
 (0)