Remove graph.Err helper function

Since Err() is now a member of the Iterator interface, we don't need
this helper function anymore.
This commit is contained in:
Andrew Dunham 2015-04-15 11:15:55 -07:00
parent 745d4874e6
commit 33dd596ab4
8 changed files with 8 additions and 19 deletions

View file

@ -177,17 +177,6 @@ func Next(it Iterator) bool {
return false
}
// Err is a convenience function that conditionally calls the Err method
// of an Iterator if it is a Nexter. If the Iterator is not a Nexter, Err
// returns nil.
func Err(it Iterator) error {
if n, ok := it.(Nexter); ok {
return n.Err()
}
glog.Errorln("Calling Err on an un-nextable iterator")
return nil
}
// Height is a convienence function to measure the height of an iterator tree.
func Height(it Iterator, until Type) int {
if it.Type() == until {

View file

@ -154,7 +154,7 @@ func (it *And) Next() bool {
return graph.NextLogOut(it, curr, true)
}
}
if err := graph.Err(it.primaryIt); err != nil {
if err := it.primaryIt.Err(); err != nil {
it.err = err
}
return graph.NextLogOut(it, nil, false)

View file

@ -203,7 +203,7 @@ func (it *HasA) Next() bool {
it.resultIt = &Null{}
if !graph.Next(it.primaryIt) {
if err := graph.Err(it.primaryIt); err != nil {
if err := it.primaryIt.Err(); err != nil {
it.err = err
}
return graph.NextLogOut(it, 0, false)

View file

@ -166,7 +166,7 @@ func (it *LinksTo) Next() bool {
}
// If there's an error in the 'next' iterator, we save it and we're done.
if err := graph.Err(it.nextIt); err != nil {
if err := it.nextIt.Err(); err != nil {
it.err = err
return false
}

View file

@ -206,7 +206,7 @@ func (it *Materialize) Next() bool {
}
if it.aborted {
n := graph.Next(it.subIt)
if err := graph.Err(it.subIt); err != nil {
if err := it.subIt.Err(); err != nil {
it.err = err
}
return n
@ -296,7 +296,7 @@ func (it *Materialize) materializeSet() {
it.actualSize += 1
}
}
if err := graph.Err(it.subIt); err != nil {
if err := it.subIt.Err(); err != nil {
it.err = err
} else if it.aborted {
if glog.V(2) {

View file

@ -88,7 +88,7 @@ func (it *Not) Next() bool {
return graph.NextLogOut(it, curr, true)
}
}
if err := graph.Err(it.allIt); err != nil {
if err := it.allIt.Err(); err != nil {
it.err = err
}
return graph.NextLogOut(it, nil, false)

View file

@ -148,7 +148,7 @@ func (it *Or) Next() bool {
return graph.NextLogOut(it, it.result, true)
}
if err := graph.Err(curIt); err != nil {
if err := curIt.Err(); err != nil {
it.err = err
return graph.NextLogOut(it, nil, false)
}

View file

@ -134,7 +134,7 @@ func (it *Comparison) Next() bool {
return true
}
}
if err := graph.Err(it.subIt); err != nil {
if err := it.subIt.Err(); err != nil {
it.err = err
}
return false