mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 13:19:47 +00:00
LibUnicode: Cache the system time zone
It's expensive to determine the system time zone from disk each time it is requested. This makes LibUnicode cache the result, and provides an API to clear that cache. This will let us set up a monitor to watch for system time zone changes in platform-dependent ways.
This commit is contained in:
committed by
Andreas Kling
parent
e25681203e
commit
b31c11bca5
@@ -16,6 +16,7 @@ public:
|
||||
: m_time_zone(Core::Environment::get("TZ"sv))
|
||||
{
|
||||
MUST(Core::Environment::set("TZ"sv, time_zone, Core::Environment::Overwrite::Yes));
|
||||
Unicode::clear_system_time_zone_cache();
|
||||
}
|
||||
|
||||
~TimeZoneGuard()
|
||||
@@ -24,6 +25,7 @@ public:
|
||||
MUST(Core::Environment::set("TZ"sv, *m_time_zone, Core::Environment::Overwrite::Yes));
|
||||
else
|
||||
MUST(Core::Environment::unset("TZ"sv));
|
||||
Unicode::clear_system_time_zone_cache();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user