MCPcopy Create free account
hub / github.com/CyCoreSystems/ari-proxy / Remove

Method Remove

session/objects.go:45–56  ·  view source on GitHub ↗

Remove removes the given object, if it exists

(id string)

Source from the content-addressed store, hash-verified

43
44// Remove removes the given object, if it exists
45func (o *Objects) Remove(id string) bool {
46 idx, ok := o.Contains(id)
47 if !ok {
48 return false
49 }
50
51 o.mutex.Lock()
52 defer o.mutex.Unlock()
53 o.ids = append(o.ids[:idx], o.ids[idx+1:]...)
54
55 return true
56}
57
58// Clear removes all the objects
59func (o *Objects) Clear() {

Callers 1

TestObjectsRemoveFunction · 0.95

Calls 1

ContainsMethod · 0.95

Tested by 1

TestObjectsRemoveFunction · 0.76