Skip to content

Commit

Permalink
language-server: more uses of Set instead of List when checking for d…
Browse files Browse the repository at this point in the history
…uplicate names
  • Loading branch information
joshtynjala committed Oct 30, 2024
1 parent 3c37e12 commit 9619256
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ private void autoCompleteFunctionOverrides(IASNode node, AddImportData addImport
} while (classDefinition instanceof IClassDefinition);

List<CompletionItem> resultItems = result.getItems();
ArrayList<String> functionNames = new ArrayList<>();
Set<String> functionNames = new HashSet<>();
for (IDefinition definition : propertyDefinitions) {
if (!(definition instanceof IFunctionDefinition) || definition.isStatic()) {
continue;
Expand Down Expand Up @@ -1908,7 +1908,7 @@ private void addDefinitionsInTypeScopeToAutoComplete(TypeScope typeScope, ASScop
private void addEventMetadataToAutoCompleteMXML(TypeScope typeScope, boolean isAttribute, String prefix,
boolean includeOpenTagBracket, boolean includeOpenTagPrefix, char nextChar, ILspProject project,
CompletionList result) {
ArrayList<String> eventNames = new ArrayList<>();
Set<String> eventNames = new HashSet<>();
IDefinition definition = typeScope.getDefinition();
while (definition instanceof IClassDefinition) {
IClassDefinition classDefinition = (IClassDefinition) definition;
Expand Down Expand Up @@ -1971,7 +1971,7 @@ private void addEventMetadataToAutoCompleteMXML(TypeScope typeScope, boolean isA
private void addStyleMetadataToAutoCompleteMXML(TypeScope typeScope, boolean isAttribute, String prefix,
boolean includeOpenTagBracket, boolean includeOpenTagPrefix, char nextChar, ILspProject project,
CompletionList result) {
ArrayList<String> styleNames = new ArrayList<>();
Set<String> styleNames = new HashSet<>();
IDefinition definition = typeScope.getDefinition();
List<CompletionItem> items = result.getItems();
while (definition instanceof IClassDefinition) {
Expand Down

0 comments on commit 9619256

Please sign in to comment.