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

Method Contains

factstore/factstore.go:188–195  ·  view source on GitHub ↗

Contains returns true if this store contains this atom already.

(a ast.Atom)

Source from the content-addressed store, hash-verified

186
187// Contains returns true if this store contains this atom already.
188func (s SimpleInMemoryStore) Contains(a ast.Atom) bool {
189 key := a.Hash()
190 if atoms, ok := s.shardsByPredicate[a.Predicate]; ok {
191 _, ok := atoms[key]
192 return ok
193 }
194 return false
195}
196
197// Merge adds all facts from other to this fact store.
198func (s SimpleInMemoryStore) Merge(other ReadOnlyFactStore) {

Callers 15

TestRoundTripFunction · 0.95
TestMergedAddContainsFunction · 0.95
TestShortestPathsFunction · 0.95
runEvalFunction · 0.95
TestNegationFunction · 0.95
TestNegationOrderFunction · 0.95
TestSimpleEvalFunction · 0.95
TestSimpleEvalDeferFunction · 0.95
TestManyPathsFunction · 0.95
TestNonLinearFunction · 0.95
TestBuiltinFunction · 0.95

Calls 1

HashMethod · 0.65

Tested by 15

TestRoundTripFunction · 0.76
TestMergedAddContainsFunction · 0.76
TestShortestPathsFunction · 0.76
runEvalFunction · 0.76
TestNegationFunction · 0.76
TestNegationOrderFunction · 0.76
TestSimpleEvalFunction · 0.76
TestSimpleEvalDeferFunction · 0.76
TestManyPathsFunction · 0.76
TestNonLinearFunction · 0.76
TestBuiltinFunction · 0.76