summaryrefslogtreecommitdiff
path: root/Meta/Lagom
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-01-30 17:35:24 -0500
committerLinus Groh <mail@linusgroh.de>2022-01-31 00:32:41 +0000
commit2e1db1b09029dbf8cb318bb6fa8c8e9beeb07f99 (patch)
tree3384d4f532a70f95bb94eb6909b8dbc58dbdc6d5 /Meta/Lagom
parentbb0f548614ba1b788a2d9f3e5ce7d99d3228e3be (diff)
downloadserenity-2e1db1b09029dbf8cb318bb6fa8c8e9beeb07f99.zip
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.
Diffstat (limited to 'Meta/Lagom')
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp15
1 files changed, 2 insertions, 13 deletions
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<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;
-}
}
)~~~");