File tree Expand file tree Collapse file tree 3 files changed +6
-20
lines changed Expand file tree Collapse file tree 3 files changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,9 @@ ada_really_inline constexpr bool contains_forbidden_domain_code_point(
94
94
* then the second bit is set to 1.
95
95
* @see https://url.spec.whatwg.org/#forbidden-domain-code-point
96
96
*/
97
- ada_really_inline constexpr bool contains_forbidden_domain_code_point_or_upper (
98
- const char * input, size_t length) noexcept ;
97
+ ada_really_inline constexpr uint8_t
98
+ contains_forbidden_domain_code_point_or_upper (const char * input,
99
+ size_t length) noexcept ;
99
100
100
101
/* *
101
102
* Checks if the input is a forbidden doamin code point.
Original file line number Diff line number Diff line change @@ -223,8 +223,9 @@ static_assert(sizeof(is_forbidden_domain_code_point_table_or_upper) == 256);
223
223
static_assert (is_forbidden_domain_code_point_table_or_upper[uint8_t (' A' )] == 2 );
224
224
static_assert (is_forbidden_domain_code_point_table_or_upper[uint8_t (' Z' )] == 2 );
225
225
226
- ada_really_inline constexpr bool contains_forbidden_domain_code_point_or_upper (
227
- const char * input, size_t length) noexcept {
226
+ ada_really_inline constexpr uint8_t
227
+ contains_forbidden_domain_code_point_or_upper (const char * input,
228
+ size_t length) noexcept {
228
229
size_t i = 0 ;
229
230
uint8_t accumulator{};
230
231
for (; i + 4 <= length; i += 4 ) {
Original file line number Diff line number Diff line change @@ -479,22 +479,6 @@ ada_really_inline bool url_aggregator::parse_host(std::string_view input) {
479
479
}
480
480
ada_log (" parse_host fast path " , get_hostname ());
481
481
return true ;
482
- } else if (is_forbidden_or_upper == 2 ) {
483
- // We have encountered at least one upper case ASCII letter, let us
484
- // try to convert it to lower case. If there is no 'xn-' in the result,
485
- // we can then use a secondary fast path.
486
- std::string _buffer = std::string (input);
487
- unicode::to_lower_ascii (_buffer.data (), _buffer.size ());
488
- if (input.find (" xn-" ) == std::string_view::npos) {
489
- // secondary fast path when input is not all lower case
490
- update_base_hostname (input);
491
- if (checkers::is_ipv4 (get_hostname ())) {
492
- ada_log (" parse_host fast path ipv4" );
493
- return parse_ipv4 (get_hostname ());
494
- }
495
- ada_log (" parse_host fast path " , get_hostname ());
496
- return true ;
497
- }
498
482
}
499
483
// We have encountered at least one forbidden code point or the input contains
500
484
// 'xn-' (case insensitive), so we need to call 'to_ascii' to perform the full
You can’t perform that action at this time.
0 commit comments