mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
refactor: remove dup code
Signed-off-by: hyschumi<msliudongsheng@gmail.com>
This commit is contained in:
parent
2f21cff49d
commit
da5d0a72d9
@ -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{}) {
|
||||
|
Loading…
Reference in New Issue
Block a user