mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 17:51:21 +00:00
remove superfluous lookups
Since we seed the joinResult with the nodes from the topology we are mapping to, we know the 'create' function is only called when there is no node with the specified id. This neatly makes the 'create' function only do what it says, i.e. return _new_ nodes.
This commit is contained in:
@@ -106,10 +106,8 @@ func (e endpoints2Processes) Render(rpt report.Report) Nodes {
|
||||
hostID, _, _ := report.ParseNodeID(hostNodeID)
|
||||
id := report.MakeProcessNodeID(hostID, pid)
|
||||
ret.addChild(n, id, func(id string) report.Node {
|
||||
if processNode, found := processes.Nodes[id]; found {
|
||||
return processNode
|
||||
}
|
||||
// we have a pid, but no matching process node; create a new one rather than dropping the data
|
||||
// we have a pid, but no matching process node;
|
||||
// create a new one rather than dropping the data
|
||||
return report.MakeNode(id).WithTopology(report.Process).
|
||||
WithLatest(process.PID, timestamp, pid)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user