Skip to content

Commit

Permalink
Angular: Very minor performance improvement.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: ce034f505aee1638de4e02fc26e9fee1fdeed1c0
  • Loading branch information
piotrtomiak authored and intellij-monorepo-bot committed Nov 9, 2022
1 parent e56a7bb commit 969efd4
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ public class AddNgModuleImportQuickFix extends LocalQuickFixAndIntentionActionOn
public AddNgModuleImportQuickFix(@NotNull PsiElement context,
@NotNull Collection<Angular2Declaration> importableDeclarations) {
super(context);
var scope = new Angular2DeclarationsScope(context);
List<String> names = StreamEx.of(importableDeclarations)
.flatCollection(declaration -> {
if (declaration.isStandalone()) {
return List.of(declaration);
}
else {
return new Angular2DeclarationsScope(context).getPublicModulesExporting(declaration);
}
})
.flatCollection(declaration -> declaration.isStandalone()
? List.of(declaration)
: scope.getPublicModulesExporting(declaration))
.distinct()
.map(Angular2Entity::getClassName)
.distinct()
Expand Down

0 comments on commit 969efd4

Please sign in to comment.