mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:07:35 +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
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue