Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
valerian-roche committed Mar 23, 2022
1 parent b70d21f commit 8a5129f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/cache/v3/linear.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,9 @@ func (cache *LinearCache) CreateDeltaWatch(request *DeltaRequest, state stream.S
defer cache.mu.Unlock()

if cache.versionMap == nil {
// If we had no delta watch before, we need to build the version map for the first time.
// The map will not be removed when the last delta watch is removed to avoid rebuilding it constantly when only a few delta watches are applicable.
// If we had no previously open delta watches, we need to build the version map for the first time.
// The version map will not be destroyed when the last delta watch is removed.
// This avoids constantly rebuilding when only a few delta watches are open.
modified := map[string]struct{}{}
for name := range cache.resources {
modified[name] = struct{}{}
Expand Down

0 comments on commit 8a5129f

Please sign in to comment.