mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:47:45 +00:00
LibUnicode: Generate locale subtag data as multiple smaller tables
This commit is preemptive to upcoming commits which add more subtags to the CLDR generator. Rather than generating a giant HashMap containing all data, generate more (smaller) Array-based tables. This mimics the UCD generator. This also allows simpler lookups at runtime since we can generate index-based lookups into the smaller tables rather easily. Without this change, adding the remaining locale subtags would result in the generation and compilation of UnicodeLocale.cpp taking about 30s on my machine. With this change, it takes about half that. Additionally, the size of the generated file reduces by about 1.5MB.
This commit is contained in:
parent
b8ad4d302e
commit
6719e5cb17
4 changed files with 91 additions and 69 deletions
|
@ -40,6 +40,6 @@ Optional<String> canonicalize_unicode_locale_id(LocaleID&);
|
|||
String const& default_locale();
|
||||
bool is_locale_available(StringView locale);
|
||||
|
||||
Optional<StringView> get_locale_territory_mapping(StringView locale, StringView code);
|
||||
Optional<StringView> get_locale_territory_mapping(StringView locale, StringView territory);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue