From 2e1db1b09029dbf8cb318bb6fa8c8e9beeb07f99 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 30 Jan 2022 17:35:24 -0500 Subject: 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. --- .../CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'Meta/Lagom') diff --git a/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp index 524955e226..082694b997 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp @@ -619,22 +619,11 @@ Optional> get_named_time_zone_offsets(TimeZone time_zone, return named_offsets; } +)~~~"); -Span 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; -} } )~~~"); -- cgit v1.2.3