Skip to content

Commit

Permalink
flatpak: Use a set() instead of array when gathering locale variants.
Browse files Browse the repository at this point in the history
Minor optimization -

This prevents having duplicates of locale names - if the locale is
'de', you'd end up with  the initial 'de', then the single variant
added would also be 'de'.
  • Loading branch information
mtwebster committed Jul 27, 2024
1 parent 3ee0f2f commit 71d2c5f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ def update_xmlb_info(self):
return

locale = self.as_pool.get_locale()
locale_variants = [locale]
locale_variants = {locale}
for v in GLib.get_locale_variants(locale):
locale_variants.append(locale_to_bcp47(v))
locale_variants.add(locale_to_bcp47(v))

for comp_id in self.app_dict.keys():
try:
Expand Down

0 comments on commit 71d2c5f

Please sign in to comment.