1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibRegex: Use spans<4> to avoid allocating small vectors

This path is hit a lot, and alloc/free of this vector was showing up on
profiles, so get rid of it.
This commit is contained in:
Ali Mohammad Pur 2022-11-03 10:40:39 +03:30 committed by Ali Mohammad Pur
parent f1851346d3
commit 253f4de302

View file

@ -546,7 +546,7 @@ ALWAYS_INLINE ExecutionResult OpCode_Compare::execute(MatchInput const& input, M
return ExecutionResult::Failed_ExecuteLowPrioForks;
auto count = m_bytecode->at(offset++);
auto range_data = m_bytecode->spans().slice(offset, count);
auto range_data = m_bytecode->template spans<4>().slice(offset, count);
offset += count;
auto ch = input.view.substring_view(state.string_position, 1)[0];