MCPcopy
hub / github.com/kubernetes/client-go / addIfNotPresentLocked

Method addIfNotPresentLocked

tools/cache/heap.go:209–214  ·  view source on GitHub ↗

addIfNotPresentLocked assumes the lock is already held and adds the provided item to the queue if it does not already exist.

(key string, obj interface{})

Source from the content-addressed store, hash-verified

207// addIfNotPresentLocked assumes the lock is already held and adds the provided
208// item to the queue if it does not already exist.
209func (h *Heap) addIfNotPresentLocked(key string, obj interface{}) {
210 if _, exists := h.data.items[key]; exists {
211 return
212 }
213 heap.Push(h.data, &itemKeyValue{key, obj})
214}
215
216// Update is the same as Add in this implementation. When the item does not
217// exist, it is added.

Callers 3

AddMethod · 0.95
BulkAddMethod · 0.95
AddIfNotPresentMethod · 0.95

Calls 1

PushMethod · 0.45

Tested by

no test coverage detected