refactor(watcher): make authSliceToMap always return map
This commit is contained in:
@@ -263,9 +263,6 @@ func (w *Watcher) computePerPathUpdatesLocked(oldByID, newByID map[string]*corea
|
||||
}
|
||||
|
||||
func authSliceToMap(auths []*coreauth.Auth) map[string]*coreauth.Auth {
|
||||
if len(auths) == 0 {
|
||||
return nil
|
||||
}
|
||||
byID := make(map[string]*coreauth.Auth, len(auths))
|
||||
for _, a := range auths {
|
||||
if a == nil || strings.TrimSpace(a.ID) == "" {
|
||||
@@ -273,9 +270,6 @@ func authSliceToMap(auths []*coreauth.Auth) map[string]*coreauth.Auth {
|
||||
}
|
||||
byID[a.ID] = a
|
||||
}
|
||||
if len(byID) == 0 {
|
||||
return nil
|
||||
}
|
||||
return byID
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user