From 48da8a568d80fe4a1bf72d4c3fdfe0f3ed5a8c84 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 3 Jun 2021 12:56:32 +0200 Subject: [PATCH] AK: Remove unused JsonValue <=> IPv4Address conversion code This removes code that isn't used anywhere. --- AK/JsonValue.cpp | 5 ----- AK/JsonValue.h | 9 --------- Userland/Utilities/ifconfig.cpp | 1 + 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/AK/JsonValue.cpp b/AK/JsonValue.cpp index b8df21f8118..7f2dc7d99d4 100644 --- a/AK/JsonValue.cpp +++ b/AK/JsonValue.cpp @@ -181,11 +181,6 @@ JsonValue::JsonValue(const String& value) } } -JsonValue::JsonValue(const IPv4Address& value) - : JsonValue(value.to_string()) -{ -} - JsonValue::JsonValue(const JsonObject& value) : m_type(Type::Object) { diff --git a/AK/JsonValue.h b/AK/JsonValue.h index 755c72dc4e8..93cea679f3a 100644 --- a/AK/JsonValue.h +++ b/AK/JsonValue.h @@ -7,7 +7,6 @@ #pragma once #include -#include #include #include #include @@ -55,7 +54,6 @@ public: JsonValue(bool); JsonValue(const char*); JsonValue(const String&); - JsonValue(const IPv4Address&); JsonValue(const JsonArray&); JsonValue(const JsonObject&); @@ -85,13 +83,6 @@ public: return serialized(); } - Optional to_ipv4_address() const - { - if (!is_string()) - return {}; - return IPv4Address::from_string(as_string()); - } - int to_int(int default_value = 0) const { return to_i32(default_value); } i32 to_i32(i32 default_value = 0) const { return to_number(default_value); } i64 to_i64(i64 default_value = 0) const { return to_number(default_value); } diff --git a/Userland/Utilities/ifconfig.cpp b/Userland/Utilities/ifconfig.cpp index bdc7ccbcfc7..24330ddceb8 100644 --- a/Userland/Utilities/ifconfig.cpp +++ b/Userland/Utilities/ifconfig.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include