refactor(watcher): make authSliceToMap always return map

This commit is contained in:
lyd123qw2008
2026-03-02 10:09:56 +08:00
parent 10fa0f2062
commit dd44413ba5
2 changed files with 8 additions and 11 deletions
-6
View File
@@ -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
}