fix(windows): restore indexed descendant row walk

This commit is contained in:
Merge Sim
2026-09-02 14:21:01 -07:00
parent b36a5d3537
commit f34a91d039
2 changed files with 3 additions and 53 deletions
@@ -124,10 +124,11 @@ export function windowsDescendantsFromRows<Row extends { pid: number; ppid: numb
rows: Row[],
rootPid: number
): (Row & { depth: number })[] | null {
if (!rows.some((row) => row.pid === rootPid)) {
const index = getProcessTableIndex(rows)
if (!index.byPid.has(rootPid)) {
return null
}
return collectDescendants(rows, rootPid).sort((a, b) => b.depth - a.depth)
return collectDescendantsFromIndex(index, rootPid).sort((a, b) => b.depth - a.depth)
}
/** Test-only: clear the shared snapshot so one case's rows never serve the next. */