Contains returns true if this store contains this atom already.
(a ast.Atom)
| 186 | |
| 187 | // Contains returns true if this store contains this atom already. |
| 188 | func (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. |
| 198 | func (s SimpleInMemoryStore) Merge(other ReadOnlyFactStore) { |