mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 11:18:13 +00:00
LibJS+LibUnicode: Remove unnecessary locale currency mapping wrapper
Before LibUnicode generated methods were weakly linked, we had a public method (get_locale_currency_mapping) for retrieving currency mappings. That method invoked one of several style-specific methods that only existed in the generated UnicodeLocale. One caveat of weakly linked functions is that every such function must have a public declaration. The result is that each of those styled methods are declared publicly, which makes the wrapper redundant because it is just as easy to invoke the method for the desired style.
This commit is contained in:
parent
0d75949827
commit
8126cb2545
4 changed files with 7 additions and 25 deletions
|
@ -762,23 +762,6 @@ Optional<StringView> __attribute__((weak)) get_locale_calendar_mapping(StringVie
|
|||
Optional<StringView> __attribute__((weak)) get_locale_long_date_field_mapping(StringView, StringView) { return {}; }
|
||||
Optional<StringView> __attribute__((weak)) get_locale_short_date_field_mapping(StringView, StringView) { return {}; }
|
||||
Optional<StringView> __attribute__((weak)) get_locale_narrow_date_field_mapping(StringView, StringView) { return {}; }
|
||||
|
||||
Optional<StringView> get_locale_currency_mapping(StringView locale, StringView currency, Style style)
|
||||
{
|
||||
switch (style) {
|
||||
case Style::Long:
|
||||
return get_locale_long_currency_mapping(locale, currency);
|
||||
case Style::Short:
|
||||
return get_locale_short_currency_mapping(locale, currency);
|
||||
case Style::Narrow:
|
||||
return get_locale_narrow_currency_mapping(locale, currency);
|
||||
case Style::Numeric:
|
||||
return get_locale_numeric_currency_mapping(locale, currency);
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
Optional<StringView> __attribute__((weak)) get_locale_key_mapping(StringView, StringView) { return {}; }
|
||||
|
||||
Vector<StringView> get_locale_key_mapping_list(StringView locale, StringView keyword)
|
||||
|
|
|
@ -159,7 +159,6 @@ Optional<StringView> get_locale_long_currency_mapping(StringView locale, StringV
|
|||
Optional<StringView> get_locale_short_currency_mapping(StringView locale, StringView currency);
|
||||
Optional<StringView> get_locale_narrow_currency_mapping(StringView locale, StringView currency);
|
||||
Optional<StringView> get_locale_numeric_currency_mapping(StringView locale, StringView currency);
|
||||
Optional<StringView> get_locale_currency_mapping(StringView locale, StringView currency, Style style);
|
||||
Optional<StringView> get_locale_calendar_mapping(StringView locale, StringView calendar);
|
||||
Optional<StringView> get_locale_long_date_field_mapping(StringView locale, StringView date_field);
|
||||
Optional<StringView> get_locale_short_date_field_mapping(StringView locale, StringView date_field);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue