mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Addresses the issue which caused #109115
This commit is contained in:
parent
56159f258c
commit
cbbb5f70a4
@ -280,18 +280,15 @@ func (c *threadSafeMap) updateIndices(oldObj interface{}, newObj interface{}, ke
|
|||||||
c.indices[name] = index
|
c.indices[name] = index
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, value := range oldIndexValues {
|
if len(indexValues) == 1 && len(oldIndexValues) == 1 && indexValues[0] == oldIndexValues[0] {
|
||||||
// We optimize for the most common case where indexFunc returns a single value.
|
// We optimize for the most common case where indexFunc returns a single value which has not been changed
|
||||||
if len(indexValues) == 1 && value == indexValues[0] {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, value := range oldIndexValues {
|
||||||
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 indexFunc returns a single value.
|
|
||||||
if len(oldIndexValues) == 1 && value == oldIndexValues[0] {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
c.addKeyToIndex(key, value, index)
|
c.addKeyToIndex(key, value, index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user