in grpc-xds/control-plane-go/pkg/applications/application_cache.go [37:52]
func (c *ApplicationCache) Put(kubecontextName string, namespace string, apps []Application) bool {
if apps == nil {
apps = []Application{}
}
slices.SortFunc(apps, func(a Application, b Application) int {
return a.Compare(b)
})
c.mu.Lock()
defer c.mu.Unlock()
key := key(kubecontextName, namespace)
oldApps := c.cache[key]
c.cache[key] = apps
return !slices.EqualFunc(oldApps, apps, func(a Application, b Application) bool {
return a.Equal(b)
})
}