File tree 2 files changed +6
-11
lines changed
2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,10 @@ namespace ada {
24
24
* `--------------------------------------------- protocol_end
25
25
*/
26
26
// These conditions can be made more strict.
27
- uint32_t index = 0 ;
28
-
29
27
if (protocol_end == url_components::omitted) {
30
28
return false ;
31
29
}
32
- if (protocol_end < index ) {
33
- return false ;
34
- }
35
- index = protocol_end;
30
+ uint32_t index = protocol_end;
36
31
37
32
if (username_end == url_components::omitted) {
38
33
return false ;
Original file line number Diff line number Diff line change @@ -716,7 +716,7 @@ bool url::set_host_or_hostname(const std::string_view input) {
716
716
717
717
bool succeeded = parse_host (host_view);
718
718
if (!succeeded) {
719
- host = previous_host;
719
+ host = std::move ( previous_host) ;
720
720
update_base_port (previous_port);
721
721
}
722
722
return succeeded;
@@ -733,13 +733,13 @@ bool url::set_host_or_hostname(const std::string_view input) {
733
733
} else {
734
734
// Let host be the result of host parsing buffer with url is not special.
735
735
if (!parse_host (new_host)) {
736
- host = previous_host;
736
+ host = std::move ( previous_host) ;
737
737
update_base_port (previous_port);
738
738
return false ;
739
739
}
740
740
741
741
// If host is "localhost", then set host to the empty string.
742
- if (host. has_value () && host. value () == " localhost" ) {
742
+ if (host == " localhost" ) {
743
743
host = " " ;
744
744
}
745
745
}
@@ -794,7 +794,7 @@ bool url::set_port(const std::string_view input) {
794
794
if (is_valid) {
795
795
return true ;
796
796
}
797
- port = previous_port;
797
+ port = std::move ( previous_port) ;
798
798
is_valid = true ;
799
799
return false ;
800
800
}
@@ -835,7 +835,7 @@ bool url::set_pathname(const std::string_view input) {
835
835
if (has_opaque_path) {
836
836
return false ;
837
837
}
838
- path = " " ;
838
+ path. clear () ;
839
839
parse_path (input);
840
840
return true ;
841
841
}
You can’t perform that action at this time.
0 commit comments