1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:27:45 +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:
Timothy Flynn 2022-01-12 17:19:59 -05:00 committed by Linus Groh
parent 0d75949827
commit 8126cb2545
4 changed files with 7 additions and 25 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Tim Flynn <trflynn89@pm.me>
* Copyright (c) 2021-2022, Tim Flynn <trflynn89@pm.me>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -85,13 +85,13 @@ StringView NumberFormat::resolve_currency_display()
m_resolved_currency_display = currency();
break;
case NumberFormat::CurrencyDisplay::Symbol:
m_resolved_currency_display = Unicode::get_locale_currency_mapping(data_locale(), currency(), Unicode::Style::Short);
m_resolved_currency_display = Unicode::get_locale_short_currency_mapping(data_locale(), currency());
break;
case NumberFormat::CurrencyDisplay::NarrowSymbol:
m_resolved_currency_display = Unicode::get_locale_currency_mapping(data_locale(), currency(), Unicode::Style::Narrow);
m_resolved_currency_display = Unicode::get_locale_narrow_currency_mapping(data_locale(), currency());
break;
case NumberFormat::CurrencyDisplay::Name:
m_resolved_currency_display = Unicode::get_locale_currency_mapping(data_locale(), currency(), Unicode::Style::Numeric);
m_resolved_currency_display = Unicode::get_locale_numeric_currency_mapping(data_locale(), currency());
break;
default:
VERIFY_NOT_REACHED();