mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibUnicode: Cache all created icu::TimeZone objects
This cache works exactly the same as the existing icu::Locale cache.
This commit is contained in:
parent
6becd13a83
commit
d392c38a73
Notes:
github-actions[bot]
2024-09-03 17:26:56 +00:00
Author: https://github.com/trflynn89
Commit: d392c38a73
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1266
5 changed files with 45 additions and 7 deletions
|
@ -622,9 +622,9 @@ static void apply_time_zone_to_formatter(icu::SimpleDateFormat& formatter, icu::
|
|||
{
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
auto* time_zone = icu::TimeZone::createTimeZone(icu_string(time_zone_identifier));
|
||||
auto time_zone_data = TimeZoneData::for_time_zone(time_zone_identifier);
|
||||
|
||||
auto* calendar = icu::Calendar::createInstance(time_zone, locale, status);
|
||||
auto* calendar = icu::Calendar::createInstance(time_zone_data->time_zone(), locale, status);
|
||||
VERIFY(icu_success(status));
|
||||
|
||||
if (calendar->getDynamicClassID() == icu::GregorianCalendar::getStaticClassID()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue