Intermediate step in removal of Base

We are marking types that will be Nexters and ResultNexters (I want a
better name for this one).
This commit is contained in:
kortschak 2014-07-30 15:21:48 +09:30
parent 375d953d93
commit b498a06a7b
13 changed files with 42 additions and 56 deletions

View file

@ -38,7 +38,6 @@ import (
// An optional iterator has the sub-constraint iterator we wish to be optional
// and whether the last check we received was true or false.
type Optional struct {
Base
uid uint64
tags graph.Tagger
subIt graph.Iterator
@ -48,14 +47,14 @@ type Optional struct {
// Creates a new optional iterator.
func NewOptional(it graph.Iterator) *Optional {
var o Optional
BaseInit(&o.Base)
o.canNext = false
o.subIt = it
o.uid = NextUID()
return &o
return &Optional{
uid: NextUID(),
subIt: it,
}
}
func (it *Optional) CanNext() bool { return false }
func (it *Optional) UID() uint64 {
return it.uid
}