Move Size handling out of Base
This commit is contained in:
parent
525230206a
commit
ee6d4c8db7
5 changed files with 17 additions and 5 deletions
|
|
@ -240,3 +240,7 @@ func (it *HasA) Close() {
|
|||
|
||||
// Register this iterator as a HasA.
|
||||
func (it *HasA) Type() graph.Type { return graph.HasA }
|
||||
|
||||
func (it *HasA) Size() (int64, bool) {
|
||||
return 0, true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,11 +80,6 @@ func (it *Base) Result() graph.Value {
|
|||
return it.Last
|
||||
}
|
||||
|
||||
// If you're empty and you know it, clap your hands.
|
||||
func (it *Base) Size() (int64, bool) {
|
||||
return 0, true
|
||||
}
|
||||
|
||||
// Accessor
|
||||
func (it *Base) CanNext() bool { return it.canNext }
|
||||
|
||||
|
|
|
|||
|
|
@ -200,3 +200,7 @@ func (it *LinksTo) Stats() graph.IteratorStats {
|
|||
Size: fanoutFactor * subitStats.Size,
|
||||
}
|
||||
}
|
||||
|
||||
func (it *LinksTo) Size() (int64, bool) {
|
||||
return 0, true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,3 +151,8 @@ func (it *Optional) Stats() graph.IteratorStats {
|
|||
Size: subStats.Size,
|
||||
}
|
||||
}
|
||||
|
||||
// If you're empty and you know it, clap your hands.
|
||||
func (it *Optional) Size() (int64, bool) {
|
||||
return 0, true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,3 +212,7 @@ func (it *Comparison) Optimize() (graph.Iterator, bool) {
|
|||
func (it *Comparison) Stats() graph.IteratorStats {
|
||||
return it.subIt.Stats()
|
||||
}
|
||||
|
||||
func (it *Base) Size() (int64, bool) {
|
||||
return 0, true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue