@@ -427,9 +427,7 @@ result_type parse_url_impl(std::string_view user_input,
427427 } else {
428428 url.update_base_authority (base_url->get_href (),
429429 base_url->get_components ());
430- // TODO: Get rid of set_hostname and replace it with
431- // update_base_hostname
432- url.set_hostname (base_url->get_hostname ());
430+ url.update_host_to_base_host (base_url->get_hostname ());
433431 url.update_base_port (base_url->retrieve_base_port ());
434432 // cloning the base path includes cloning the has_opaque_path flag
435433 url.has_opaque_path = base_url->has_opaque_path ;
@@ -497,9 +495,7 @@ result_type parse_url_impl(std::string_view user_input,
497495 } else {
498496 url.update_base_authority (base_url->get_href (),
499497 base_url->get_components ());
500- // TODO: Get rid of set_hostname and replace it with
501- // update_base_hostname
502- url.set_hostname (base_url->get_hostname ());
498+ url.update_host_to_base_host (base_url->get_hostname ());
503499 url.update_base_port (base_url->retrieve_base_port ());
504500 }
505501 state = ada::state::PATH;
@@ -736,8 +732,7 @@ result_type parse_url_impl(std::string_view user_input,
736732 if constexpr (result_type_is_ada_url) {
737733 url.host = base_url->host ;
738734 } else {
739- // TODO: Optimization opportunity.
740- url.set_host (base_url->get_host ());
735+ url.update_host_to_base_host (base_url->get_host ());
741736 }
742737 // If the code point substring from pointer to the end of input does
743738 // not start with a Windows drive letter and base's path[0] is a
@@ -848,9 +843,7 @@ result_type parse_url_impl(std::string_view user_input,
848843 url.path = base_url->path ;
849844 url.query = base_url->query ;
850845 } else {
851- // TODO: Get rid of set_hostname and replace it with
852- // update_base_hostname
853- url.set_hostname (base_url->get_hostname ());
846+ url.update_host_to_base_host (base_url->get_hostname ());
854847 url.update_base_pathname (base_url->get_pathname ());
855848 url.update_base_search (base_url->get_search ());
856849 }
0 commit comments