mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #26925 from ZTE-PaaS/249043822-patch-1
Automatic merge from submit-queue optimize deleteFromIndices method of thread_safe_store As all methods of thread_safe_store are threadsafe, so i think, in deleteFromIndices method, if the index is nil, need not run the for structure below
This commit is contained in:
commit
59b88d7ab6
11
pkg/client/cache/thread_safe_store.go
vendored
11
pkg/client/cache/thread_safe_store.go
vendored
@ -261,12 +261,13 @@ func (c *threadSafeMap) deleteFromIndices(obj interface{}, key string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
index := c.indices[name]
|
index := c.indices[name]
|
||||||
|
if index == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
for _, indexValue := range indexValues {
|
for _, indexValue := range indexValues {
|
||||||
if index != nil {
|
set := index[indexValue]
|
||||||
set := index[indexValue]
|
if set != nil {
|
||||||
if set != nil {
|
set.Delete(key)
|
||||||
set.Delete(key)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user