Skip to content

Commit

Permalink
Merge pull request #77 from niklak/feature/mini-selector-revise-3
Browse files Browse the repository at this point in the history
src/mini_selector/extension.rs: update
  • Loading branch information
niklak authored Feb 28, 2025
2 parents 37f7270 + bac5b20 commit 9586ab6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/mini_selector/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 9586ab6

Please sign in to comment.