mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
AK: Add a consume_until(StringView) overload to GenericLexer
This allows us to skip a strlen call.
This commit is contained in:
parent
10b25d2a57
commit
d49d2c7ec4
Notes:
sideshowbarker
2024-07-17 20:16:15 +09:00
Author: https://github.com/IdanHo
Commit: d49d2c7ec4
Pull-request: https://github.com/SerenityOS/serenity/pull/12120
Reviewed-by: https://github.com/alimpfard ✅
3 changed files with 18 additions and 1 deletions
|
@ -356,7 +356,7 @@ String Preprocessor::remove_escaped_newlines(StringView value)
|
|||
AK::StringBuilder processed_value;
|
||||
GenericLexer lexer { value };
|
||||
while (!lexer.is_eof()) {
|
||||
processed_value.append(lexer.consume_until("\\\n"));
|
||||
processed_value.append(lexer.consume_until("\\\n"sv));
|
||||
}
|
||||
return processed_value.to_string();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue