mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
Merge pull request #858 from weaveworks/immutable-nodeset
use immutability for the NodeSet
This commit is contained in:
@@ -101,15 +101,13 @@ var (
|
||||
|
||||
func children(n render.RenderableNode) []NodeSummaryGroup {
|
||||
summaries := map[string][]NodeSummary{}
|
||||
for _, child := range n.Children {
|
||||
if child.ID == n.ID {
|
||||
continue
|
||||
n.Children.ForEach(func(child report.Node) {
|
||||
if child.ID != n.ID {
|
||||
if summary, ok := MakeNodeSummary(child); ok {
|
||||
summaries[child.Topology] = append(summaries[child.Topology], summary)
|
||||
}
|
||||
}
|
||||
|
||||
if summary, ok := MakeNodeSummary(child); ok {
|
||||
summaries[child.Topology] = append(summaries[child.Topology], summary)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
nodeSummaryGroups := []NodeSummaryGroup{}
|
||||
for _, spec := range nodeSummaryGroupSpecs {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package render_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/weaveworks/scope/render"
|
||||
"github.com/weaveworks/scope/report"
|
||||
"github.com/weaveworks/scope/test"
|
||||
"github.com/weaveworks/scope/test/reflect"
|
||||
)
|
||||
|
||||
func TestFilterRender(t *testing.T) {
|
||||
|
||||
@@ -141,7 +141,7 @@ func (rn RenderableNode) Copy() RenderableNode {
|
||||
func (rn RenderableNode) Prune() RenderableNode {
|
||||
cp := rn.Copy()
|
||||
cp.Node = report.MakeNode().WithAdjacent(cp.Node.Adjacency...)
|
||||
cp.Children = nil
|
||||
cp.Children = report.EmptyNodeSet
|
||||
return cp
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user