Skip to content

Commit

Permalink
[FOLD] relative
Browse files Browse the repository at this point in the history
  • Loading branch information
alandefreitas committed Aug 18, 2022
1 parent f4d9041 commit 76cb2ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 38 deletions.
25 changes: 0 additions & 25 deletions include/boost/url/authority_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1066,11 +1066,6 @@ class BOOST_SYMBOL_VISIBLE
by component as if they were first
normalized.
@par Effects
@code
return url( a0 ).normalize() != url( a1 ).normalize();
@endcode
@par Complexity
Linear in `min( a0.size(), a1.size() )`
Expand All @@ -1092,11 +1087,6 @@ class BOOST_SYMBOL_VISIBLE
by component as if they were first
normalized.
@par Effects
@code
return url( a0 ).normalize() < url( a1 ).normalize();
@endcode
@par Complexity
Linear in `min( a0.size(), a1.size() )`
Expand All @@ -1118,11 +1108,6 @@ class BOOST_SYMBOL_VISIBLE
by component as if they were first
normalized.
@par Effects
@code
return url( a0 ).normalize() <= url( a1 ).normalize();
@endcode
@par Complexity
Linear in `min( a0.size(), a1.size() )`
Expand All @@ -1144,11 +1129,6 @@ class BOOST_SYMBOL_VISIBLE
by component as if they were first
normalized.
@par Effects
@code
return url( a0 ).normalize() > url( a1 ).normalize();
@endcode
@par Complexity
Linear in `min( a0.size(), a1.size() )`
Expand All @@ -1170,11 +1150,6 @@ class BOOST_SYMBOL_VISIBLE
by component as if they were first
normalized.
@par Effects
@code
return url( a0 ).normalize() >= url( a1 ).normalize();
@endcode
@par Complexity
Linear in `min( a0.size(), a1.size() )`
Expand Down
17 changes: 4 additions & 13 deletions include/boost/url/impl/url.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,6 @@ relative(
url_view_base const& href,
url_base& dest)
{
// AFREITAS:
// - filesystem functions use
// (const path&, const path& base)
// - this function name is probably still bad
// - the function in URI.js behaves slightly
// differently from their own examples
// see https://medialize.github.io/URI.js/docs.html#relativeto
// - we have a bug where u.set_path("") or
// u.segments() = {} crash, so this function
// uses u.segments() = {"."}, which gives
// us slightly different results.
// - The basic exception guarantee is not
// satisfied in case of allocation errors.
BOOST_ASSERT(&dest != &base);
BOOST_ASSERT(&dest != &href);

Expand All @@ -171,9 +158,13 @@ relative(
// Resolve scheme
if (href.scheme() == base.scheme() ||
!href.has_scheme())
{
dest.remove_scheme();
}
else
{
dest.set_scheme(href.scheme());
}

// Resolve authority
if (dest.has_scheme() ||
Expand Down

0 comments on commit 76cb2ff

Please sign in to comment.