From 1837a926352c8d33c0fa9b1f5ba49c83edb75a40 Mon Sep 17 00:00:00 2001 From: Espen Enes Date: Thu, 21 Mar 2024 14:23:17 +0100 Subject: [PATCH] Removed the use of set when returning search results from channel_group_search --- tdm_loader/tdm_loader.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tdm_loader/tdm_loader.py b/tdm_loader/tdm_loader.py index df878cc..8c8642a 100644 --- a/tdm_loader/tdm_loader.py +++ b/tdm_loader/tdm_loader.py @@ -199,12 +199,15 @@ def channel_group_search(self, search_term): ] ind = [] + occurences = {} for name in found_terms: - for occurence in range(found_terms.count(name)): - i = self.channel_group_index(name, occurence) - ind.append((name, i)) + if name not in occurences: + occurences[name] = True + for occurence in range(found_terms.count(name)): + i = self.channel_group_index(name, occurence) + ind.append((name, i)) - return set(ind) + return ind def channel_search(self, search_term): """Returns a list of channel names that contain ``search term``.