Move UID handling from Base

Also clean up some of the value creation code.
This commit is contained in:
kortschak 2014-07-30 11:44:36 +09:30
parent 1604dca737
commit 01b7278c3a
13 changed files with 198 additions and 92 deletions

View file

@ -26,6 +26,7 @@ import (
// be Next()ed if next is called.
type And struct {
Base
uid uint64
tags graph.Tagger
internalIterators []graph.Iterator
itCount int
@ -35,13 +36,18 @@ type And struct {
// Creates a new And iterator.
func NewAnd() *And {
var and And
and := And{
uid: NextUID(),
internalIterators: make([]graph.Iterator, 0, 20),
}
BaseInit(&and.Base)
and.internalIterators = make([]graph.Iterator, 0, 20)
and.checkList = nil
return &and
}
func (it *And) UID() uint64 {
return it.uid
}
// Reset all internal iterators
func (it *And) Reset() {
it.primaryIt.Reset()