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

Method getFactsOfFirstVariable

factstore/factstore.go:400–411  ·  view source on GitHub ↗
(a ast.Atom, fn func(ast.Atom) error)

Source from the content-addressed store, hash-verified

398}
399
400func (s IndexedInMemoryStore) getFactsOfFirstVariable(a ast.Atom, fn func(ast.Atom) error) error {
401 for _, shard := range s.shardsByPredicate[a.Predicate] {
402 for _, fact := range shard {
403 if Matches(a.Args[1:], fact.Args[1:]) {
404 if err := fn(fact); err != nil {
405 return err
406 }
407 }
408 }
409 }
410 return nil
411}
412
413// GetFacts implementation that looks up facts from an in-memory map.
414func (s IndexedInMemoryStore) GetFacts(a ast.Atom, fn func(ast.Atom) error) error {

Callers 1

GetFactsMethod · 0.95

Calls 1

MatchesFunction · 0.85

Tested by

no test coverage detected