MCPcopy
hub / github.com/google/mangle / Remove

Method Remove

factstore/factstore.go:173–185  ·  view source on GitHub ↗

Remove removes the fact from the backing map.

(a ast.Atom)

Source from the content-addressed store, hash-verified

171
172// Remove removes the fact from the backing map.
173func (s SimpleInMemoryStore) Remove(a ast.Atom) bool {
174 key := a.Hash()
175 if atoms, ok := s.shardsByPredicate[a.Predicate]; ok {
176 if _, ok := atoms[key]; ok {
177 delete(atoms, key)
178 if len(atoms) == 0 {
179 delete(s.shardsByPredicate, a.Predicate)
180 }
181 return true
182 }
183 }
184 return false
185}
186
187// Contains returns true if this store contains this atom already.
188func (s SimpleInMemoryStore) Contains(a ast.Atom) bool {

Callers

nothing calls this directly

Calls 1

HashMethod · 0.65

Tested by

no test coverage detected