Move UID handling from Base
Also clean up some of the value creation code.
This commit is contained in:
parent
1604dca737
commit
01b7278c3a
13 changed files with 198 additions and 92 deletions
|
|
@ -27,6 +27,7 @@ import (
|
|||
|
||||
type Iterator struct {
|
||||
iterator.Base
|
||||
uid uint64
|
||||
tags graph.Tagger
|
||||
tree *llrb.LLRB
|
||||
data string
|
||||
|
|
@ -54,14 +55,20 @@ func IterateOne(tree *llrb.LLRB, last Int64) Int64 {
|
|||
}
|
||||
|
||||
func NewLlrbIterator(tree *llrb.LLRB, data string) *Iterator {
|
||||
var it Iterator
|
||||
it := Iterator{
|
||||
uid: iterator.NextUID(),
|
||||
tree: tree,
|
||||
iterLast: Int64(-1),
|
||||
data: data,
|
||||
}
|
||||
iterator.BaseInit(&it.Base)
|
||||
it.tree = tree
|
||||
it.iterLast = Int64(-1)
|
||||
it.data = data
|
||||
return &it
|
||||
}
|
||||
|
||||
func (it *Iterator) UID() uint64 {
|
||||
return it.uid
|
||||
}
|
||||
|
||||
func (it *Iterator) Reset() {
|
||||
it.iterLast = Int64(-1)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue