Refactor of caching & data storage part 7 #118

This commit is contained in:
Ian Renton
2026-08-01 10:34:20 +01:00
parent b7d2cf0fdb
commit 41aecc6007
10 changed files with 121 additions and 105 deletions
+3 -4
View File
@@ -23,14 +23,13 @@ class K0SWE(FileDownloadStaticDataProvider):
for dxcc in dxcc_list:
dxcc_map[dxcc["entityCode"]] = dxcc
# Precompile regex matches for DXCCs to improve efficiency when iterating through them
for dxcc in dxcc_map.values():
dxcc["_prefixRegexCompiled"] = re.compile(dxcc["prefixRegex"])
# Add to data store
for k, v in dxcc_map.items():
DATA_STORE.dxcc_data[k] = v
# Regenerate in-memory regex-to-DXCC-entity-code map.
DATA_STORE.regenerateCallRegexToDXCCEntityMap()
return True
except Exception as e: