merge to master
This commit is contained in:
commit
c64acabee0
30 changed files with 645 additions and 334 deletions
|
|
@ -44,7 +44,7 @@ type Iterator struct {
|
|||
}
|
||||
|
||||
func NewIterator(prefix string, d quad.Direction, value graph.Value, qs *TripleStore) graph.Iterator {
|
||||
vb := value.([]byte)
|
||||
vb := value.(Token)
|
||||
p := make([]byte, 0, 2+qs.hasher.Size())
|
||||
p = append(p, []byte(prefix)...)
|
||||
p = append(p, []byte(vb[1:])...)
|
||||
|
|
@ -107,7 +107,7 @@ func (it *Iterator) TagResults(dst map[string]graph.Value) {
|
|||
}
|
||||
|
||||
func (it *Iterator) Clone() graph.Iterator {
|
||||
out := NewIterator(it.originalPrefix, it.dir, it.checkId, it.qs)
|
||||
out := NewIterator(it.originalPrefix, it.dir, Token(it.checkId), it.qs)
|
||||
out.Tagger().CopyFrom(it)
|
||||
return out
|
||||
}
|
||||
|
|
@ -145,12 +145,12 @@ func (it *Iterator) Next() (graph.Value, bool) {
|
|||
}
|
||||
out := make([]byte, len(it.iter.Key()))
|
||||
copy(out, it.iter.Key())
|
||||
it.result = out
|
||||
it.result = Token(out)
|
||||
ok := it.iter.Next()
|
||||
if !ok {
|
||||
it.Close()
|
||||
}
|
||||
return out, true
|
||||
return Token(out), true
|
||||
}
|
||||
it.Close()
|
||||
it.result = nil
|
||||
|
|
@ -227,7 +227,7 @@ func PositionOf(prefix []byte, d quad.Direction, qs *TripleStore) int {
|
|||
}
|
||||
|
||||
func (it *Iterator) Contains(v graph.Value) bool {
|
||||
val := v.([]byte)
|
||||
val := v.(Token)
|
||||
if val[0] == 'z' {
|
||||
return false
|
||||
}
|
||||
|
|
@ -248,7 +248,7 @@ func (it *Iterator) Contains(v graph.Value) bool {
|
|||
}
|
||||
|
||||
func (it *Iterator) Size() (int64, bool) {
|
||||
return it.qs.SizeOf(it.checkId), true
|
||||
return it.qs.SizeOf(Token(it.checkId)), true
|
||||
}
|
||||
|
||||
func (it *Iterator) DebugString(indent int) string {
|
||||
|
|
@ -260,7 +260,7 @@ func (it *Iterator) DebugString(indent int) string {
|
|||
it.tags.Tags(),
|
||||
it.dir,
|
||||
size,
|
||||
it.qs.NameOf(it.checkId),
|
||||
it.qs.NameOf(Token(it.checkId)),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue