Skip to content

Commit f1f9488

Browse files
committed
refactor: use Set instead of List
1 parent 5b3ec9f commit f1f9488

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/kotlin/com/github/tempest/framework/ComponentTagNameProvider.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ComponentTagNameProvider : XmlTagNameProvider {
1313
) {
1414
val project = tag.project
1515

16-
val result = mutableListOf<String>()
16+
val result = mutableSetOf<String>()
1717
FilenameIndex.processAllFileNames(
1818
{
1919
if (it.startsWith("x-") && it.endsWith(TempestFrameworkUtil.TEMPLATE_PREFIX)) {
@@ -29,8 +29,9 @@ class ComponentTagNameProvider : XmlTagNameProvider {
2929
null,
3030
)
3131

32-
result.distinct().map {
33-
LookupElementBuilder.create(it).withIcon(TempestIcons.TEMPEST).withTypeText("Tempest Component")
34-
}.apply { elements.addAll(this) }
32+
elements.addAll(
33+
result.map {
34+
LookupElementBuilder.create(it).withIcon(TempestIcons.TEMPEST).withTypeText("Tempest Component")
35+
})
3536
}
3637
}

0 commit comments

Comments
 (0)