Skip to content

Commit a2c4b2f

Browse files
committed
fix: replace += with list.extend; replace another for loop w/ extend
Relace one more for loop with list.extend(a new list comprehension). Using += is less performance than a .extend.
1 parent 3616827 commit a2c4b2f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

roundup/i18n.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,17 @@ def get_translation(language=None, tracker_home=None,
204204
# add mofiles found in the tracker, then in the system locale directory
205205
if tracker_locale:
206206
mofiles.append(get_mofile(locales, tracker_locale))
207-
mofiles += [get_mofile(locales, system_locale, DOMAIN)
208-
for system_locale in LOCALE_DIRS]
207+
mofiles.extend([get_mofile(locales, system_locale, DOMAIN)
208+
for system_locale in LOCALE_DIRS])
209209

210210
# we want to fall back to english unless english is selected language
211211
if "en" not in locales:
212212
locales = find_locales("en")
213213
# add mofiles found in the tracker, then in the system locale directory
214214
if tracker_locale:
215215
mofiles.append(get_mofile(locales, tracker_locale))
216-
for system_locale in LOCALE_DIRS:
217-
mofiles.append(get_mofile(locales, system_locale, DOMAIN))
216+
mofiles.extend([get_mofile(locales, system_locale, DOMAIN)
217+
for system_locale in LOCALE_DIRS])
218218
# filter out elements that are not found
219219
mofiles = filter(None, mofiles)
220220
translator = None

0 commit comments

Comments
 (0)