mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 07:22:21 +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
|
@ -14,7 +14,7 @@ namespace URL::Pattern {
|
|||
String escape_a_pattern_string(String const& input)
|
||||
{
|
||||
// 1. Assert: input is an ASCII string.
|
||||
VERIFY(all_of(input.code_points(), is_ascii));
|
||||
VERIFY(input.is_ascii());
|
||||
|
||||
// 2. Let result be the empty string.
|
||||
StringBuilder result;
|
||||
|
@ -51,7 +51,7 @@ String escape_a_pattern_string(String const& input)
|
|||
String escape_a_regexp_string(String const& input)
|
||||
{
|
||||
// 1. Assert: input is an ASCII string.
|
||||
VERIFY(all_of(input.code_points(), is_ascii));
|
||||
VERIFY(input.is_ascii());
|
||||
|
||||
// 2. Let result be the empty string.
|
||||
StringBuilder builder;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue