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
|
|
@ -39,6 +39,7 @@ import (
|
|||
// and whether the last check we received was true or false.
|
||||
type Optional struct {
|
||||
Base
|
||||
uid uint64
|
||||
tags graph.Tagger
|
||||
subIt graph.Iterator
|
||||
lastCheck bool
|
||||
|
|
@ -50,9 +51,14 @@ func NewOptional(it graph.Iterator) *Optional {
|
|||
BaseInit(&o.Base)
|
||||
o.canNext = false
|
||||
o.subIt = it
|
||||
o.uid = NextUID()
|
||||
return &o
|
||||
}
|
||||
|
||||
func (it *Optional) UID() uint64 {
|
||||
return it.uid
|
||||
}
|
||||
|
||||
func (it *Optional) Reset() {
|
||||
it.subIt.Reset()
|
||||
it.lastCheck = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue