mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
AK+LibURL+LibWeb: Use simdutf to validate ASCII strings
simdutf provides a vectorized ASCII validator, so let's use that instead of looping over strings manually.
This commit is contained in:
parent
212095e1c2
commit
ee6b2db009
Notes:
github-actions[bot]
2025-04-06 15:06:55 +00:00
Author: https://github.com/trflynn89
Commit: ee6b2db009
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4252
10 changed files with 32 additions and 11 deletions
|
@ -196,7 +196,7 @@ Optional<String> Host::public_suffix() const
|
|||
auto public_suffix = get_public_suffix(host_string.bytes_as_string_view()).value_or("*"_string);
|
||||
|
||||
// 4. Assert: publicSuffix is an ASCII string that does not end with ".".
|
||||
VERIFY(all_of(public_suffix.code_points(), is_ascii));
|
||||
VERIFY(public_suffix.is_ascii());
|
||||
VERIFY(!public_suffix.ends_with('.'));
|
||||
|
||||
// 5. Return publicSuffix and trailingDot concatenated.
|
||||
|
@ -223,7 +223,7 @@ Optional<String> Host::registrable_domain() const
|
|||
auto registrable_domain = get_registrable_domain(host_string).value_or("*"_string);
|
||||
|
||||
// 4. Assert: registrableDomain is an ASCII string that does not end with ".".
|
||||
VERIFY(all_of(registrable_domain.code_points(), is_ascii));
|
||||
VERIFY(registrable_domain.is_ascii());
|
||||
VERIFY(!registrable_domain.ends_with('.'));
|
||||
|
||||
// 5. Return registrableDomain and trailingDot concatenated.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue