Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/mini_selector/extension.rs: update #77

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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