mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
AK+LibRegex: Only set node metadata on Trie::ensure_child if missing
a290034a81 passed an empty vector to this,
which caused nodes that appeared multiple times to reset the trie
metadata...which broke the optimisation.
This patchset makes the function take a 'provide missing metadata'
function instead, and only invokes it when the node is missing rather
than unconditionally setting the metadata on all nodes.
This commit is contained in:
parent
2c5beeabe3
commit
d5d37abfa5
Notes:
github-actions[bot]
2025-11-21 01:47:30 +00:00
Author: https://github.com/alimpfard
Commit: d5d37abfa5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6890
2 changed files with 17 additions and 11 deletions
|
|
@ -1467,7 +1467,7 @@ void Optimizer::append_alternation(ByteCode& target, Span<ByteCode> alternatives
|
|||
node_key_bytes.append(edge.jump_insn);
|
||||
}
|
||||
|
||||
active_node = static_cast<decltype(active_node)>(MUST(active_node->ensure_child(DisjointSpans<ByteCodeValueType const> { move(node_key_bytes) }, Vector<NodeMetadataEntry> {})));
|
||||
active_node = static_cast<decltype(active_node)>(MUST(active_node->ensure_child(DisjointSpans<ByteCodeValueType const> { move(node_key_bytes) }, [] -> Vector<NodeMetadataEntry> { return {}; })));
|
||||
|
||||
auto next_compare = [&alternative, &state](StaticallyInterpretedCompares& compares) {
|
||||
TemporaryChange state_change { state.instruction_position, state.instruction_position };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue