Remove stream overhead for ConformanceRules#BanSetAttribute checks
@@ -2251,11 +2251,13 @@ public final class ConformanceRules {
return ConformanceResult.VIOLATION;
}
if (keyType.isUnionType()) {
- if (keyType.toMaybeUnionType().getAlternates().stream().anyMatch(JSType::isString)) {
+ for (JSType alternate : keyType.toMaybeUnionType().getAlternates()) {
+ if (alternate.isString()) {
return ConformanceResult.VIOLATION;
}
}
}
+ }
return ConformanceResult.CONFORMANCE;
}
