mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +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
|
@ -47,7 +47,7 @@ GC::Ref<Policy> Policy::parse_a_serialized_csp(JS::Realm& realm, Variant<ByteBuf
|
|||
auto stripped_token_view = stripped_token.bytes_as_string_view();
|
||||
|
||||
// 2. If token is an empty string, or if token is not an ASCII string, continue.
|
||||
if (stripped_token.is_empty() || !all_of(stripped_token_view, is_ascii))
|
||||
if (stripped_token.is_empty() || !stripped_token_view.is_ascii())
|
||||
continue;
|
||||
|
||||
// 3. Let directive name be the result of collecting a sequence of code points from token which are not
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue