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:
k8s-merge-robot 2016-06-25 12:57:50 -07:00 committed by GitHub
commit 59b88d7ab6

View File

@ -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)
}
} }
} }
} }