1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

LibRegex: Avoid copying MatchInput when getting argument descriptions

This commit is contained in:
Ali Mohammad Pur 2022-11-03 02:04:22 +03:30 committed by Ali Mohammad Pur
parent 73fcbbb0ee
commit 464ac85a1b
2 changed files with 3 additions and 3 deletions

View file

@ -927,12 +927,12 @@ Vector<CompareTypeAndValuePair> OpCode_Compare::flat_compares() const
return result;
}
Vector<String> OpCode_Compare::variable_arguments_to_string(Optional<MatchInput> input) const
Vector<String> OpCode_Compare::variable_arguments_to_string(Optional<MatchInput const&> input) const
{
Vector<String> result;
size_t offset { state().instruction_position + 3 };
RegexStringView view = ((input.has_value()) ? input.value().view : StringView {});
RegexStringView const& view = ((input.has_value()) ? input.value().view : StringView {});
for (size_t i = 0; i < arguments_count(); ++i) {
auto compare_type = (CharacterCompareType)m_bytecode->at(offset++);