Optimize ConstraintSystemBuilderImpl::generateNewBound
Do not process the bound if it's just the same This situation can actually happen in case of adding bound containing type variable itself
This commit is contained in:
+1
@@ -82,6 +82,7 @@ private fun ConstraintSystemBuilderImpl.addConstraintFromBounds(old: Bound, new:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun ConstraintSystemBuilderImpl.generateNewBound(bound: Bound, substitution: Bound) {
|
private fun ConstraintSystemBuilderImpl.generateNewBound(bound: Bound, substitution: Bound) {
|
||||||
|
if (bound === substitution) return
|
||||||
// Let's have a bound 'T <=> My<R>', and a substitution 'R <=> Type'.
|
// Let's have a bound 'T <=> My<R>', and a substitution 'R <=> Type'.
|
||||||
// Here <=> means lower_bound, upper_bound or exact_bound constraint.
|
// Here <=> means lower_bound, upper_bound or exact_bound constraint.
|
||||||
// Then a new bound 'T <=> My<_/in/out Type>' can be generated.
|
// Then a new bound 'T <=> My<_/in/out Type>' can be generated.
|
||||||
|
|||||||
Reference in New Issue
Block a user