summaryrefslogtreecommitdiff
path: root/Userland/Utilities/route.cpp
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-12-22 14:28:43 +0000
committerTim Flynn <trflynn89@pm.me>2023-02-03 07:19:52 -0500
commit8c4abf0ed85eeb106b2ce60ac505f831a49f11a4 (patch)
tree805db99282ae6b6cdf80b05b779053c59c2df56b /Userland/Utilities/route.cpp
parentf1f02b33e6d097b549b4307997cb3b2eb3ebc7ac (diff)
downloadserenity-8c4abf0ed85eeb106b2ce60ac505f831a49f11a4.zip
Utilities/route: Replace uses of JsonObject::get_deprecated()/get_ptr()
Diffstat (limited to 'Userland/Utilities/route.cpp')
-rw-r--r--Userland/Utilities/route.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Utilities/route.cpp b/Userland/Utilities/route.cpp
index 1c6e75f05a..93c89a0167 100644
--- a/Userland/Utilities/route.cpp
+++ b/Userland/Utilities/route.cpp
@@ -101,17 +101,17 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
Vector<JsonValue> sorted_regions = json.as_array().values();
quick_sort(sorted_regions, [](auto& a, auto& b) {
- return a.as_object().get_deprecated("destination"sv).to_deprecated_string() < b.as_object().get_deprecated("destination"sv).to_deprecated_string();
+ return a.as_object().get_deprecated_string("destination"sv).value_or({}) < b.as_object().get_deprecated_string("destination"sv).value_or({});
});
for (auto& value : sorted_regions) {
auto& if_object = value.as_object();
- auto destination = if_object.get_deprecated("destination"sv).to_deprecated_string();
- auto gateway = if_object.get_deprecated("gateway"sv).to_deprecated_string();
- auto genmask = if_object.get_deprecated("genmask"sv).to_deprecated_string();
- auto interface = if_object.get_deprecated("interface"sv).to_deprecated_string();
- auto flags = if_object.get_deprecated("flags"sv).to_u32();
+ auto destination = if_object.get_deprecated_string("destination"sv).value_or({});
+ auto gateway = if_object.get_deprecated_string("gateway"sv).value_or({});
+ auto genmask = if_object.get_deprecated_string("genmask"sv).value_or({});
+ auto interface = if_object.get_deprecated_string("interface"sv).value_or({});
+ auto flags = if_object.get_u32("flags"sv).value_or(0);
StringBuilder flags_builder;
if (flags & RTF_UP)