refactor: optimise report.Sets.Delete() going empty

Mainly for consistencty; we do something similar NodeSet.Delete().
This commit is contained in:
Matthias Radestock
2017-07-03 03:19:52 +01:00
parent 430e74a80a
commit cfbbdf7bf0

View File

@@ -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.