]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
importer: Return known countries as a set()
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2024 09:50:44 +0000 (09:50 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2024 09:50:44 +0000 (09:50 +0000)
It should be possible to search through sets quicker.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/location-importer.in

index 4a487c95f0a5ff4b722ca19adeb61e3139b7418f..9b83f3fcf244f6e6e9096c6981138c1abe65ff4c 100644 (file)
@@ -307,7 +307,7 @@ class CLI(object):
                # Fetch all valid country codes to check parsed networks aganist...
                countries = self.db.query("SELECT country_code FROM countries ORDER BY country_code")
 
-               return [country.country_code for country in countries]
+               return set((country.country_code for country in countries))
 
        def handle_write(self, ns):
                """