diff --git a/graph/iterator/materialize_iterator.go b/graph/iterator/materialize_iterator.go index e488a31..46baf0c 100644 --- a/graph/iterator/materialize_iterator.go +++ b/graph/iterator/materialize_iterator.go @@ -32,8 +32,8 @@ type result struct { tags map[string]graph.Value } -type hashable interface { - Hashable() interface{} +type hasher interface { + Hasher() interface{} } type Materialize struct { @@ -205,8 +205,8 @@ func (it *Materialize) Contains(v graph.Value) bool { return it.subIt.Contains(v) } key := v - if h, ok := v.(hashable); ok { - key = h.Hashable() + if h, ok := v.(hasher); ok { + key = h.Hasher() } if i, ok := it.containsMap[key]; ok { it.index = i @@ -246,8 +246,8 @@ func (it *Materialize) materializeSet() { break } val := id - if h, ok := id.(hashable); ok { - val = h.Hashable() + if h, ok := id.(hasher); ok { + val = h.Hasher() } if _, ok := it.containsMap[val]; !ok { it.containsMap[val] = len(it.values) diff --git a/graph/leveldb/triplestore.go b/graph/leveldb/triplestore.go index 8ba7bde..2bd1279 100644 --- a/graph/leveldb/triplestore.go +++ b/graph/leveldb/triplestore.go @@ -44,7 +44,7 @@ const ( type Token []byte -func (t Token) Hashable() interface{} { +func (t Token) Hasher() interface{} { return string(t) } diff --git a/graph/triplestore.go b/graph/triplestore.go index 195b687..5a68841 100644 --- a/graph/triplestore.go +++ b/graph/triplestore.go @@ -37,7 +37,7 @@ import ( // pointers to structs, or merely triples, or whatever works best for the // backing store. // -// These must be comparable, or implement a `Hashable() interface{}` function +// These must be comparable, or implement a `Hasher() interface{}` function // so that they may be stored in maps. type Value interface{}