mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-16 03:49:52 +00:00
cosmetic
This commit is contained in:
@@ -81,8 +81,7 @@ func (m *Map) Render(rpt report.Report, dct Decorator) report.Nodes {
|
||||
// Rewrite all the nodes according to the map function
|
||||
for _, inRenderable := range input {
|
||||
for _, outRenderable := range m.MapFunc(inRenderable, localNetworks) {
|
||||
existing, ok := output[outRenderable.ID]
|
||||
if ok {
|
||||
if existing, ok := output[outRenderable.ID]; ok {
|
||||
outRenderable = outRenderable.Merge(existing)
|
||||
}
|
||||
|
||||
|
||||
@@ -39,16 +39,13 @@ func (c EdgeMetadatas) Add(key string, value EdgeMetadata) EdgeMetadatas {
|
||||
if existingValue, ok := c.psMap.Lookup(key); ok {
|
||||
value = value.Merge(existingValue.(EdgeMetadata))
|
||||
}
|
||||
return EdgeMetadatas{
|
||||
c.psMap.Set(key, value),
|
||||
}
|
||||
return EdgeMetadatas{c.psMap.Set(key, value)}
|
||||
}
|
||||
|
||||
// Lookup the counter 'key'
|
||||
func (c EdgeMetadatas) Lookup(key string) (EdgeMetadata, bool) {
|
||||
if c.psMap != nil {
|
||||
existingValue, ok := c.psMap.Lookup(key)
|
||||
if ok {
|
||||
if existingValue, ok := c.psMap.Lookup(key); ok {
|
||||
return existingValue.(EdgeMetadata), true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,7 @@ func (s Sets) Add(key string, value StringSet) Sets {
|
||||
if existingValue, ok := s.psMap.Lookup(key); ok {
|
||||
value = value.Merge(existingValue.(StringSet))
|
||||
}
|
||||
return Sets{
|
||||
psMap: s.psMap.Set(key, value),
|
||||
}
|
||||
return Sets{psMap: s.psMap.Set(key, value)}
|
||||
}
|
||||
|
||||
// Delete the given set from the Sets.
|
||||
@@ -51,9 +49,7 @@ func (s Sets) Delete(key string) Sets {
|
||||
if s.psMap == nil {
|
||||
return EmptySets
|
||||
}
|
||||
return Sets{
|
||||
psMap: s.psMap.Delete(key),
|
||||
}
|
||||
return Sets{psMap: s.psMap.Delete(key)}
|
||||
}
|
||||
|
||||
// Lookup returns the sets stored under key.
|
||||
|
||||
Reference in New Issue
Block a user