Merge pull request #106153 from hyschumi/refactor_thread_safe_store

refactor: remove dup code
This commit is contained in:
Kubernetes Prow Robot 2021-12-07 17:25:59 -08:00 committed by GitHub
commit e9fc46750f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,11 +71,7 @@ type threadSafeMap struct {
}
func (c *threadSafeMap) Add(key string, obj interface{}) {
c.lock.Lock()
defer c.lock.Unlock()
oldObject := c.items[key]
c.items[key] = obj
c.updateIndices(oldObject, obj, key)
c.Update(key, obj)
}
func (c *threadSafeMap) Update(key string, obj interface{}) {