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

Selector performance #72380

Merged
merged 5 commits into from
Jul 20, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove dead code
  • Loading branch information
oatkiller committed Jul 18, 2020
commit 3356c2d8334f5da9d8e30b5fd2a1f146d4b9f84c
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,6 @@ export function parent(
}
}

/**
* Returns the following sibling
*/
export function siblings(tree: IndexedProcessTree, node: ResolverEvent): ResolverEvent[] {
// this can be undefined, since a node may have no parent.
const parentID: string | undefined = uniqueParentPidForProcess(node);

// nodes with the same parent ID.
// if `node` has no parent ID, this is nodes with no parent ID.
const childrenWithTheSameParent: undefined | ResolverEvent[] = tree.idToChildren.get(parentID);

// this shouldn't happen if the node was in `tree`.
if (!childrenWithTheSameParent) {
return [];
}

// Return all children with the same parent as `node`, except `node` itself.
return [...childrenWithTheSameParent.filter((child) => child !== node)];
}

/**
* Number of processes in the tree
*/
Expand Down