mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
libutil: Use default operator== for ParsedURL
The default comparison operator can be generated by the compiler since C++20.
This commit is contained in:
parent
ad449c0288
commit
d020f21a2a
2 changed files with 1 additions and 7 deletions
|
|
@ -15,7 +15,7 @@ struct ParsedURL
|
||||||
|
|
||||||
std::string to_string() const;
|
std::string to_string() const;
|
||||||
|
|
||||||
bool operator==(const ParsedURL & other) const noexcept;
|
bool operator==(const ParsedURL & other) const noexcept = default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove `.` and `..` path elements.
|
* Remove `.` and `..` path elements.
|
||||||
|
|
|
||||||
|
|
@ -110,12 +110,6 @@ std::ostream & operator<<(std::ostream & os, const ParsedURL & url)
|
||||||
return os;
|
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 ParsedURL::canonicalise()
|
||||||
{
|
{
|
||||||
ParsedURL res(*this);
|
ParsedURL res(*this);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue