mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-08-25 23:08:44 +00:00
Revert "Fix segfault in model.Tree(procs)"
This reverts commit 83b81769df
.
This commit is contained in:
parent
83b81769df
commit
2d47ebf3cf
@ -46,15 +46,14 @@ func Tree(procs []*Proc) []*Proc {
|
||||
var (
|
||||
nodes []*Proc
|
||||
parent *Proc
|
||||
children []*Proc
|
||||
)
|
||||
for _, proc := range procs {
|
||||
if proc.PPID == 0 {
|
||||
nodes = append(nodes, proc)
|
||||
parent = proc
|
||||
parent.Children = children
|
||||
continue
|
||||
} else {
|
||||
children = append(children, proc)
|
||||
parent.Children = append(parent.Children, proc)
|
||||
}
|
||||
}
|
||||
return nodes
|
||||
|
Loading…
Reference in New Issue
Block a user