Base nexting on interface satisfaction
This is done unsubtlely at the moment and there is plenty of room for optimisation of assertion location to prevent repeated reasserting as is done now.
This commit is contained in:
parent
b498a06a7b
commit
d6f94be514
27 changed files with 57 additions and 82 deletions
|
|
@ -30,8 +30,6 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/barakmich/glog"
|
||||
|
||||
"github.com/google/cayley/graph"
|
||||
)
|
||||
|
||||
|
|
@ -78,16 +76,6 @@ func (it *Optional) Clone() graph.Iterator {
|
|||
return out
|
||||
}
|
||||
|
||||
// FIXME(kortschak) When we create a Nexter interface the
|
||||
// following two methods need to go away.
|
||||
|
||||
// Nexting the iterator is unsupported -- error and return an empty set.
|
||||
// (As above, a reasonable alternative would be to Next() an all iterator)
|
||||
func (it *Optional) Next() (graph.Value, bool) {
|
||||
glog.Errorln("Nexting an un-nextable iterator")
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// DEPRECATED
|
||||
func (it *Optional) ResultTree() *graph.ResultTree {
|
||||
return graph.NewResultTree(it.Result())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue