MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / optimize

Function optimize

tools/python-3.11.9-amd64/Tools/i18n/makelocalealias.py:104–116  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

102 # Additions are not mentioned
103
104def optimize(data):
105 locale_alias = locale.locale_alias
106 locale.locale_alias = data.copy()
107 for k, v in data.items():
108 del locale.locale_alias[k]
109 if locale.normalize(k) != v:
110 locale.locale_alias[k] = v
111 newdata = locale.locale_alias
112 errors = check(data)
113 locale.locale_alias = locale_alias
114 if errors:
115 sys.exit(1)
116 return newdata
117
118def check(data):
119 # Check that all alias definitions from the X11 file

Callers 1

makelocalealias.pyFile · 0.70

Calls 5

checkFunction · 0.70
copyMethod · 0.45
itemsMethod · 0.45
normalizeMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected