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

Method Merge

factstore/factstore.go:522–529  ·  view source on GitHub ↗

Merge adds all facts from other to this fact store.

(other ReadOnlyFactStore)

Source from the content-addressed store, hash-verified

520
521// Merge adds all facts from other to this fact store.
522func (s IndexedInMemoryStore) Merge(other ReadOnlyFactStore) {
523 for _, pred := range other.ListPredicates() {
524 other.GetFacts(ast.NewQuery(pred), func(fact ast.Atom) error {
525 s.Add(fact)
526 return nil
527 })
528 }
529}
530
531// ListPredicates returns a list of predicates.
532func (s IndexedInMemoryStore) ListPredicates() []ast.PredicateSym {

Callers

nothing calls this directly

Calls 4

AddMethod · 0.95
NewQueryFunction · 0.92
ListPredicatesMethod · 0.65
GetFactsMethod · 0.65

Tested by

no test coverage detected