mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
refactor: optimise report.Sets.Delete() going empty
Mainly for consistencty; we do something similar NodeSet.Delete().
This commit is contained in:
@@ -47,9 +47,11 @@ func (s Sets) Delete(key string) Sets {
|
||||
if s.psMap == nil {
|
||||
return emptySets
|
||||
}
|
||||
return Sets{
|
||||
psMap: s.psMap.Delete(key),
|
||||
psMap := s.psMap.Delete(key)
|
||||
if psMap.IsNil() {
|
||||
return emptySets
|
||||
}
|
||||
return Sets{psMap: psMap}
|
||||
}
|
||||
|
||||
// Lookup returns the sets stored under key.
|
||||
|
||||
Reference in New Issue
Block a user