mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +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:
committed by
Andreas Kling
parent
6becd13a83
commit
d392c38a73
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user