mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +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
5
pkg/client/cache/thread_safe_store.go
vendored
5
pkg/client/cache/thread_safe_store.go
vendored
@ -261,15 +261,16 @@ func (c *threadSafeMap) deleteFromIndices(obj interface{}, key string) error {
|
||||
}
|
||||
|
||||
index := c.indices[name]
|
||||
if index == nil {
|
||||
continue
|
||||
}
|
||||
for _, indexValue := range indexValues {
|
||||
if index != nil {
|
||||
set := index[indexValue]
|
||||
if set != nil {
|
||||
set.Delete(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user