From b2720e6f62ae8a22f70c0b40506731e7e2c3015b Mon Sep 17 00:00:00 2001 From: Paul Goins Date: Wed, 10 Nov 2010 23:35:48 +0900 Subject: [PATCH] Removed duplicates from search on kd2.py. --- jblite/kd2.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/jblite/kd2.py b/jblite/kd2.py index 3734d72..f9a458c 100644 --- a/jblite/kd2.py +++ b/jblite/kd2.py @@ -226,10 +226,15 @@ class Database(BaseDatabase): print(u"ID: %d" % (ent_id,)) # Results: character IDs - results = list(sorted([row[0] for row in - (entries_r + entries_m + entries_n)] - + entries_i)) - + results = [] + for lst in (entries_r, entries_m, entries_n): + for row in lst: + if row[0] not in results: + results.append(row[0]) + for char_id in entries_i: + if char_id not in results: + results.append(char_id) + results = list(sorted(results)) return results def search_by_reading(self, query): -- 2.11.4.GIT