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

Method Merge

factstore/factstore.go:198–205  ·  view source on GitHub ↗

Merge adds all facts from other to this fact store.

(other ReadOnlyFactStore)

Source from the content-addressed store, hash-verified

196
197// Merge adds all facts from other to this fact store.
198func (s SimpleInMemoryStore) Merge(other ReadOnlyFactStore) {
199 for _, pred := range other.ListPredicates() {
200 other.GetFacts(ast.NewQuery(pred), func(fact ast.Atom) error {
201 s.Add(fact)
202 return nil
203 })
204 }
205}
206
207// MergedStore is an implementation of FactStore that merges multiple
208// fact stores. It dispatches lookup requests to all of them but sending

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