From 253f4de30263d56a5af57954c1da922b61674cc1 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Thu, 3 Nov 2022 10:40:39 +0330 Subject: [PATCH] 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. --- Userland/Libraries/LibRegex/RegexByteCode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibRegex/RegexByteCode.cpp b/Userland/Libraries/LibRegex/RegexByteCode.cpp index a3feeeae3b..39f292c9dd 100644 --- a/Userland/Libraries/LibRegex/RegexByteCode.cpp +++ b/Userland/Libraries/LibRegex/RegexByteCode.cpp @@ -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];