From d17ec9b2b2d1ad8dae4633b08e740bf878301189 Mon Sep 17 00:00:00 2001 From: Lulonaut Date: Wed, 28 Dec 2022 14:15:05 +0100 Subject: fix duplicates --- .../notenoughupdates/miscfeatures/MuseumCheapestItemOverlay.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main') diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/MuseumCheapestItemOverlay.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/MuseumCheapestItemOverlay.kt index bb4ae936..6cd102c9 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/MuseumCheapestItemOverlay.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/MuseumCheapestItemOverlay.kt @@ -198,6 +198,7 @@ object MuseumCheapestItemOverlay { ) val monochromeName = NEUManager.cleanForTitleMapSearch(itemName) val candidates = monochromeName.split(" ") + .asSequence() .mapNotNull { NotEnoughUpdates.INSTANCE.manager.titleWordMap[it]?.keys } .flatten() .filter { @@ -209,6 +210,9 @@ object MuseumCheapestItemOverlay { item.contains(it) } } + //filter out duplicates + .toSet() + .toList() return candidates } else { -- cgit