From bac5b2094c0ad430c0f1dc9426c01a945eabcbca Mon Sep 17 00:00:00 2001 From: Mykola Humanov Date: Fri, 28 Feb 2025 14:08:40 +0200 Subject: [PATCH] src/mini_selector/extension.rs: update --- src/mini_selector/extension.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/mini_selector/extension.rs b/src/mini_selector/extension.rs index aa40001..98c8df6 100644 --- a/src/mini_selector/extension.rs +++ b/src/mini_selector/extension.rs @@ -32,9 +32,6 @@ pub fn find_descendant_ids<'a>( // Depth-first traversal of the element tree from the current node while let Some(node_id) = ops.pop() { - // Since these nodes are descendants of the primary node and - // were previously extracted from the `Tree` with only elements remaining, - // `else` case should be unreachable. let tree_node = &nodes[node_id.value]; // If the node matches the current selector, add it to candidates @@ -61,9 +58,8 @@ pub fn find_descendant_ids<'a>( if is_last { res.extend(candidates); } else { - stack.extend(candidates); - - // Continue with the next selector since we've updated the tops + stack = candidates; + // Continue with the next selector since we've updated the stack continue 'work_loop; } }