mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-18 15:32:22 +00:00
LibRegex: Early return in Parser::try_skip()
No functional changes.
This commit is contained in:
parent
a6dfc6cdff
commit
3db7d802db
Notes:
github-actions[bot]
2025-07-22 13:11:50 +00:00
Author: https://github.com/gmta
Commit: 3db7d802db
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5558
Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 2 additions and 3 deletions
|
@ -120,10 +120,9 @@ ALWAYS_INLINE Optional<u32> Parser::consume_escaped_code_point(bool unicode)
|
|||
|
||||
ALWAYS_INLINE bool Parser::try_skip(StringView str)
|
||||
{
|
||||
if (str.starts_with(m_parser_state.current_token.value()))
|
||||
str = str.substring_view(m_parser_state.current_token.value().length(), str.length() - m_parser_state.current_token.value().length());
|
||||
else
|
||||
if (!str.starts_with(m_parser_state.current_token.value()))
|
||||
return false;
|
||||
str = str.substring_view(m_parser_state.current_token.value().length(), str.length() - m_parser_state.current_token.value().length());
|
||||
|
||||
size_t potentially_go_back { 0 };
|
||||
for (auto ch : str) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue