Fix performance regression in copy_fix.py

This commit is contained in:
Robert Müller 2024-05-19 19:47:06 +02:00
parent 8a20f0d8a2
commit fd4f61e601

View file

@ -8,7 +8,10 @@ def copy_fix(infile, delete_unused, append_missing, delete_empty):
with open(infile, encoding="utf-8") as f:
content = f.readlines()
trans = twlang.translations(infile)
if delete_unused or append_missing:
local = twlang.localizes()
else:
local = []
supported = []
for tran, (start, expr, end) in trans.items():
if delete_unused and tran not in local: