Skip to content

Commit 53996d2

Browse files
committed
Polish code.
Find a nicer way to express the same logic.
1 parent d5b14bf commit 53996d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
442442
def remove(pt: PolyType)(implicit ctx: Context): This = {
443443
def removeFromOrdering(po: ParamOrdering) = {
444444
def removeFromBoundss(key: PolyType, bndss: Array[List[PolyParam]]): Array[List[PolyParam]] = {
445-
val bndss1 = bndss.map(bnds => bnds.filterConserve(_.binder ne pt))
446-
if ((0 until bndss.length).forall(i => bndss(i) eq bndss1(i))) bndss else bndss1
445+
val bndss1 = bndss.map(_.filterConserve(_.binder ne pt))
446+
if (bndss.corresponds(bndss1)(_ eq _)) bndss else bndss1
447447
}
448448
po.remove(pt).mapValues(removeFromBoundss)
449449
}

0 commit comments

Comments
 (0)