mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +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
|
@ -514,7 +514,7 @@ static ErrorOr<String> domain_to_ascii(StringView domain, bool be_strict)
|
|||
// OPTIMIZATION: If beStrict is false, domain is an ASCII string, and strictly splitting domain on U+002E (.)
|
||||
// does not produce any item that starts with an ASCII case-insensitive match for "xn--", this
|
||||
// step is equivalent to ASCII lowercasing domain.
|
||||
if (!be_strict && all_of(domain, is_ascii)) {
|
||||
if (!be_strict && domain.is_ascii()) {
|
||||
// 3. If result is the empty string, domain-to-ASCII validation error, return failure.
|
||||
if (domain.is_empty())
|
||||
return Error::from_string_literal("Empty domain");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue