From 6b59aa0b4ad40ddb8f4be5772a13910898c02b16 Mon Sep 17 00:00:00 2001 From: Jian Li Date: Mon, 14 Mar 2022 13:56:17 +0800 Subject: [PATCH] make comments of updateIndices optimization code more accurate Kubernetes-commit: 0eae1f3addbd044793dac89f9e097e5f4c6fb2aa --- tools/cache/thread_safe_store.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cache/thread_safe_store.go b/tools/cache/thread_safe_store.go index aaf0741d..2ab92682 100644 --- a/tools/cache/thread_safe_store.go +++ b/tools/cache/thread_safe_store.go @@ -281,14 +281,14 @@ func (c *threadSafeMap) updateIndices(oldObj interface{}, newObj interface{}, ke } 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] { continue } c.deleteKeyFromIndex(key, value, index) } 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] { continue }