mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibTimeZone: Use new generator util to generate all time zones
Added the call to generate_available_values(), then realized it is the exact same as the existing, manually written implementation. So let's use the new utility.
This commit is contained in:
parent
bb0f548614
commit
2e1db1b090
Notes:
sideshowbarker
2024-07-17 19:57:46 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/2e1db1b0902 Pull-request: https://github.com/SerenityOS/serenity/pull/12223 Reviewed-by: https://github.com/linusg ✅
1 changed files with 2 additions and 13 deletions
|
@ -619,22 +619,11 @@ Optional<Array<NamedOffset, 2>> get_named_time_zone_offsets(TimeZone time_zone,
|
||||||
|
|
||||||
return named_offsets;
|
return named_offsets;
|
||||||
}
|
}
|
||||||
|
)~~~");
|
||||||
|
|
||||||
Span<StringView const> all_time_zones()
|
generate_available_values(generator, "all_time_zones"sv, time_zone_data.time_zone_names);
|
||||||
{
|
|
||||||
static constexpr auto all_time_zones = Array {
|
|
||||||
)~~~");
|
|
||||||
|
|
||||||
for (auto const& time_zone : time_zone_data.time_zone_names) {
|
|
||||||
generator.set("time_zone", time_zone);
|
|
||||||
generator.append("\"@time_zone@\"sv, ");
|
|
||||||
}
|
|
||||||
|
|
||||||
generator.append(R"~~~(
|
generator.append(R"~~~(
|
||||||
};
|
|
||||||
|
|
||||||
return all_time_zones;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
)~~~");
|
)~~~");
|
||||||
|
|
Loading…
Reference in a new issue