From d020f21a2a5dcd771988694cf634841fbcf310cd Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Fri, 18 Jul 2025 21:20:46 +0300 Subject: [PATCH] libutil: Use default operator== for ParsedURL The default comparison operator can be generated by the compiler since C++20. --- src/libutil/include/nix/util/url.hh | 2 +- src/libutil/url.cc | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/libutil/include/nix/util/url.hh b/src/libutil/include/nix/util/url.hh index 8980b4ce3..e29226720 100644 --- a/src/libutil/include/nix/util/url.hh +++ b/src/libutil/include/nix/util/url.hh @@ -15,7 +15,7 @@ struct ParsedURL std::string to_string() const; - bool operator==(const ParsedURL & other) const noexcept; + bool operator==(const ParsedURL & other) const noexcept = default; /** * Remove `.` and `..` path elements. diff --git a/src/libutil/url.cc b/src/libutil/url.cc index 67043285c..7f31d0f1c 100644 --- a/src/libutil/url.cc +++ b/src/libutil/url.cc @@ -110,12 +110,6 @@ std::ostream & operator<<(std::ostream & os, const ParsedURL & url) return os; } -bool ParsedURL::operator==(const ParsedURL & other) const noexcept -{ - return scheme == other.scheme && authority == other.authority && path == other.path && query == other.query - && fragment == other.fragment; -} - ParsedURL ParsedURL::canonicalise() { ParsedURL res(*this);