1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:08:10 +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:
Timothy Flynn 2022-01-30 17:35:24 -05:00 committed by Linus Groh
parent bb0f548614
commit 2e1db1b090

View file

@ -619,22 +619,11 @@ Optional<Array<NamedOffset, 2>> get_named_time_zone_offsets(TimeZone time_zone,
return named_offsets;
}
)~~~");
Span<StringView const> all_time_zones()
{
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, ");
}
generate_available_values(generator, "all_time_zones"sv, time_zone_data.time_zone_names);
generator.append(R"~~~(
};
return all_time_zones;
}
}
)~~~");