mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:27:45 +00:00
AK+Everywhere: Replace URL::paths() with path_segment_at_index()
This allows accessing and looping over the path segments in a URL without necessarily allocating a new vector if you want them percent decoded too (which path_segment_at_index() has an option for).
This commit is contained in:
parent
35612c6a7f
commit
5db1eb9961
6 changed files with 28 additions and 21 deletions
|
@ -226,7 +226,7 @@ void URLProvider::query(DeprecatedString const& query, Function<void(Vector<Nonn
|
|||
url.set_scheme("http");
|
||||
if (url.host().is_empty())
|
||||
url.set_host(query);
|
||||
if (url.paths().is_empty())
|
||||
if (url.path_segment_count() == 0)
|
||||
url.set_paths({ "" });
|
||||
|
||||
if (!url.is_valid())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue