Skip to content

Commit 7919795

Browse files
committed
Optimize (possibly)
1 parent d1024dd commit 7919795

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/OrderingConstraint.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,10 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
521521

522522
def mergeEntries(e1: Type, e2: Type): Type =
523523
(e1, e2) match {
524+
case _ if e1 eq e2 => e1
524525
case (e1: TypeBounds, e2: TypeBounds) => e1 & e2
525526
case (e1: TypeBounds, _) if e1 contains e2 => e2
526527
case (tv1: TypeVar, tv2: TypeVar) if tv1.instanceOpt eq tv2.instanceOpt => e1
527-
case _ if e1 eq e2 => e1
528528
case _ =>
529529
throw new AssertionError(i"cannot merge $this with $other")
530530
}

0 commit comments

Comments
 (0)