diff --git a/include/upa/url.h b/include/upa/url.h index ef2c03a..be68586 100644 --- a/include/upa/url.h +++ b/include/upa/url.h @@ -626,7 +626,7 @@ class url { std::size_t path_segment_count_ = 0; detail::url_search_params_ptr search_params_ptr_; - friend bool operator==(const url& lhs, const url& rhs); + friend bool operator==(const url& lhs, const url& rhs) noexcept; friend struct std::hash; friend detail::url_serializer; friend detail::url_setter; @@ -2930,7 +2930,7 @@ inline bool is_unc_path(const CharT* first, const CharT* last) // URL utilities (non-member functions) /// @brief Lexicographically compares two URL's -inline bool operator==(const url& lhs, const url& rhs) { +inline bool operator==(const url& lhs, const url& rhs) noexcept { return lhs.norm_url_ == rhs.norm_url_; } diff --git a/test/test-url.cpp b/test/test-url.cpp index d383ebf..1a49268 100644 --- a/test/test-url.cpp +++ b/test/test-url.cpp @@ -568,9 +568,9 @@ TEST_CASE("url_from_file_path") { } } -// Test operator== and std::hash specialization +// Test std::hash specialization and operator== -TEST_CASE("operator== && std::hash") { +TEST_CASE("std::hash and operator==") { std::unordered_map map; map.emplace(upa::url{ "about:blank" }, 1);