Skip to content

Commit

Permalink
Move the equals function to the end of url.h
Browse files Browse the repository at this point in the history
Move the `equals` function to the end of url.h at other non-members url
functions.
  • Loading branch information
rmisev committed Jan 30, 2024
1 parent 2d9aaa6 commit 936907b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions include/upa/url.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,17 +674,6 @@ class url {
friend class url_search_params;
};

/// @brief URL equivalence
///
/// Determines if @a lhs equals to @a rhs, optionally with an @a exclude_fragments flag.
/// More info: https://url.spec.whatwg.org/#concept-url-equals
///
/// @param[in] lhs,rhs URLs to compare
/// @param[in] exclude_fragments exclude fragments when comparing
inline bool equals(const url& lhs, const url& rhs, bool exclude_fragments = false) {
return lhs.serialize(exclude_fragments) == rhs.serialize(exclude_fragments);
}


namespace detail {

Expand Down Expand Up @@ -3046,6 +3035,17 @@ inline bool has_dot_dot_segment(const CharT* first, const CharT* last, IsSlash i

// URL utilities (non-member functions)

/// @brief URL equivalence
///
/// Determines if @a lhs equals to @a rhs, optionally with an @a exclude_fragments flag.
/// More info: https://url.spec.whatwg.org/#concept-url-equals
///
/// @param[in] lhs,rhs URLs to compare
/// @param[in] exclude_fragments exclude fragments when comparing
inline bool equals(const url& lhs, const url& rhs, bool exclude_fragments = false) {
return lhs.serialize(exclude_fragments) == rhs.serialize(exclude_fragments);
}

/// @brief Lexicographically compares two URL's
inline bool operator==(const url& lhs, const url& rhs) noexcept {
return lhs.norm_url_ == rhs.norm_url_;
Expand Down

0 comments on commit 936907b

Please sign in to comment.