mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-22 05:10:32 +00:00
Merge pull request #108680 from kidlj/fix_cache_index_comments
make comments of `(c *threadSafeMap) updateIndices` optimization code more accurate Kubernetes-commit: 29528a266a42bb34768db6944367946df5b0dcf6
This commit is contained in:
commit
c55e66b5a8
4
tools/cache/thread_safe_store.go
vendored
4
tools/cache/thread_safe_store.go
vendored
@ -281,14 +281,14 @@ func (c *threadSafeMap) updateIndices(oldObj interface{}, newObj interface{}, ke
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, value := range oldIndexValues {
|
for _, value := range oldIndexValues {
|
||||||
// We optimize for the most common case where index returns a single value.
|
// We optimize for the most common case where indexFunc returns a single value.
|
||||||
if len(indexValues) == 1 && value == indexValues[0] {
|
if len(indexValues) == 1 && value == indexValues[0] {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
c.deleteKeyFromIndex(key, value, index)
|
c.deleteKeyFromIndex(key, value, index)
|
||||||
}
|
}
|
||||||
for _, value := range indexValues {
|
for _, value := range indexValues {
|
||||||
// We optimize for the most common case where index returns a single value.
|
// We optimize for the most common case where indexFunc returns a single value.
|
||||||
if len(oldIndexValues) == 1 && value == oldIndexValues[0] {
|
if len(oldIndexValues) == 1 && value == oldIndexValues[0] {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user