From 08a9646f46eddab13eb4732b8914534dbb567b3e Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Thu, 19 Feb 2026 13:24:20 +0100 Subject: [PATCH] AK: Remove uneeded null StringView handling for IP string parsing A null StringView can be handled in the same way as an empty StringView, so we can remove these conditionals. --- AK/IPv4Address.h | 3 --- AK/IPv6Address.h | 3 --- 2 files changed, 6 deletions(-) diff --git a/AK/IPv4Address.h b/AK/IPv4Address.h index 1e27414c3c..5233787185 100644 --- a/AK/IPv4Address.h +++ b/AK/IPv4Address.h @@ -79,9 +79,6 @@ public: static Optional from_string(StringView string) { - if (string.is_null()) - return {}; - auto const parts = string.split_view('.'); u32 a {}; diff --git a/AK/IPv6Address.h b/AK/IPv6Address.h index b578eca064..f1d86a2396 100644 --- a/AK/IPv6Address.h +++ b/AK/IPv6Address.h @@ -119,9 +119,6 @@ public: static Optional from_string(StringView string) { - if (string.is_null()) - return {}; - // NOTE: This supports URI syntax (square brackets) for IPv6 addresses. // See: https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2 auto const starts_with_bracket = string.starts_with('[');