MCPcopy
hub / github.com/apecloud/kubeblocks / removeInvertLocked

Method removeInvertLocked

controllers/dataprotection/utils.go:562–571  ·  view source on GitHub ↗

removeInvertLocked removes a pair of referent and referenced objects from the invert map. It assumes the lock is already held by the caller.

(left string, right string)

Source from the content-addressed store, hash-verified

560// removeInvertLocked removes a pair of referent and referenced objects from the invert map.
561// It assumes the lock is already held by the caller.
562func (r *refObjectMapper) removeInvertLocked(left string, right string) {
563 l := r.invert[right]
564 for i, v := range l {
565 if v == left {
566 l[i] = l[len(l)-1]
567 r.invert[right] = l[:len(l)-1]
568 return
569 }
570 }
571}
572
573func toFlattenName(key types.NamespacedName) string {
574 return key.Namespace + "/" + key.Name

Callers 2

setRefMethod · 0.95
removeRefMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected