mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
performance (rendering): Make Node merge a mutating operation.
We only ever call it in contexts where we don't need the original node to be untouched.
This commit is contained in:
@@ -180,9 +180,11 @@ func (ret *joinResults) mapChild(from, to string) {
|
||||
// Note it is not safe to mix calls to add() with addChild(), addChildAndChildren() or addUnmappedChild()
|
||||
func (ret *joinResults) add(from string, m report.Node) {
|
||||
if existing, ok := ret.nodes[m.ID]; ok {
|
||||
m = m.Merge(existing)
|
||||
existing.UnsafeMerge(m)
|
||||
ret.nodes[m.ID] = existing
|
||||
} else {
|
||||
ret.nodes[m.ID] = m
|
||||
}
|
||||
ret.nodes[m.ID] = m
|
||||
ret.mapChild(from, m.ID)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user