mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 13:27:35 +00:00
LibRegex: Collapse some if(...) return true; else return false;
blocks
This commit is contained in:
parent
a2563496f5
commit
ca69ded9a5
2 changed files with 4 additions and 15 deletions
|
@ -284,16 +284,11 @@ ALWAYS_INLINE ExecutionResult OpCode_CheckBoundary::execute(MatchInput const& in
|
|||
auto isword = [](auto ch) { return is_ascii_alphanumeric(ch) || ch == '_'; };
|
||||
auto is_word_boundary = [&] {
|
||||
if (state.string_position == input.view.length()) {
|
||||
if (state.string_position > 0 && isword(input.view[state.string_position_in_code_units - 1]))
|
||||
return true;
|
||||
return false;
|
||||
return (state.string_position > 0 && isword(input.view[state.string_position_in_code_units - 1]));
|
||||
}
|
||||
|
||||
if (state.string_position == 0) {
|
||||
if (isword(input.view[0]))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return (isword(input.view[0]));
|
||||
}
|
||||
|
||||
return !!(isword(input.view[state.string_position_in_code_units]) ^ isword(input.view[state.string_position_in_code_units - 1]));
|
||||
|
|
|
@ -1014,10 +1014,7 @@ bool ECMA262Parser::parse_term(ByteCode& stack, size_t& match_length_minimum, bo
|
|||
return false;
|
||||
|
||||
VERIFY(did_parse_one);
|
||||
if (!parse_quantifier(atom_stack, minimum_atom_length, unicode, named))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return parse_quantifier(atom_stack, minimum_atom_length, unicode, named);
|
||||
};
|
||||
|
||||
if (!parse_with_quantifier())
|
||||
|
@ -1372,10 +1369,7 @@ bool ECMA262Parser::parse_extended_atom(ByteCode&, size_t&, bool)
|
|||
// Note: This includes only rules *not* present in parse_atom()
|
||||
VERIFY(m_should_use_browser_extended_grammar);
|
||||
|
||||
if (parse_invalid_braced_quantifier())
|
||||
return true; // FAIL FAIL FAIL
|
||||
|
||||
return false;
|
||||
return parse_invalid_braced_quantifier(); // FAIL FAIL FAIL
|
||||
}
|
||||
|
||||
bool ECMA262Parser::parse_invalid_braced_quantifier()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue