Minor, don't intersect sets, use retainAll instead
This commit is contained in:
@@ -555,12 +555,12 @@ public class TypeUtils {
|
|||||||
private static Set<JetType> getIntersectionOfSupertypes(@NotNull Collection<JetType> types) {
|
private static Set<JetType> getIntersectionOfSupertypes(@NotNull Collection<JetType> types) {
|
||||||
Set<JetType> upperBounds = Sets.newHashSet();
|
Set<JetType> upperBounds = Sets.newHashSet();
|
||||||
for (JetType type : types) {
|
for (JetType type : types) {
|
||||||
Set<JetType> supertypes = Sets.newHashSet(type.getConstructor().getSupertypes());
|
Collection<JetType> supertypes = type.getConstructor().getSupertypes();
|
||||||
if (upperBounds.isEmpty()) {
|
if (upperBounds.isEmpty()) {
|
||||||
upperBounds.addAll(supertypes);
|
upperBounds.addAll(supertypes);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
upperBounds = Sets.intersection(upperBounds, supertypes);
|
upperBounds.retainAll(supertypes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return upperBounds;
|
return upperBounds;
|
||||||
|
|||||||
Reference in New Issue
Block a user