From 53996d2952ddaeae9fd80a5ad79452d56be72678 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 23 Jun 2015 10:39:33 +0200 Subject: Polish code. Find a nicer way to express the same logic. --- src/dotty/tools/dotc/core/OrderingConstraint.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/core/OrderingConstraint.scala') diff --git a/src/dotty/tools/dotc/core/OrderingConstraint.scala b/src/dotty/tools/dotc/core/OrderingConstraint.scala index 4c52f58e8..115d0f8c0 100644 --- a/src/dotty/tools/dotc/core/OrderingConstraint.scala +++ b/src/dotty/tools/dotc/core/OrderingConstraint.scala @@ -442,8 +442,8 @@ class OrderingConstraint(private val boundsMap: ParamBounds, def remove(pt: PolyType)(implicit ctx: Context): This = { def removeFromOrdering(po: ParamOrdering) = { def removeFromBoundss(key: PolyType, bndss: Array[List[PolyParam]]): Array[List[PolyParam]] = { - val bndss1 = bndss.map(bnds => bnds.filterConserve(_.binder ne pt)) - if ((0 until bndss.length).forall(i => bndss(i) eq bndss1(i))) bndss else bndss1 + val bndss1 = bndss.map(_.filterConserve(_.binder ne pt)) + if (bndss.corresponds(bndss1)(_ eq _)) bndss else bndss1 } po.remove(pt).mapValues(removeFromBoundss) } -- cgit v1.2.3