graph/multi: use correct test for empty iterator
MODIFY
graph/multi/directed.go
graph/multi/directed.go
@@ -61,7 +61,7 @@ func (g *DirectedGraph) AddNode(n graph.Node) {
// The returned graph.Edge is a multi.Edge if an edge exists.
func (g *DirectedGraph) Edge(uid, vid int64) graph.Edge {
l := g.Lines(uid, vid)
- if l == nil {
+ if l == graph.Empty {
return nil
}
return Edge{F: g.Node(uid), T: g.Node(vid), Lines: l}

MODIFY
graph/multi/undirected.go
graph/multi/undirected.go
@@ -59,7 +59,7 @@ func (g *UndirectedGraph) AddNode(n graph.Node) {
// The returned graph.Edge is a multi.Edge if an edge exists.
func (g *UndirectedGraph) Edge(uid, vid int64) graph.Edge {
l := g.LinesBetween(uid, vid)
- if l == nil {
+ if l == graph.Empty {
return nil
}
return Edge{F: g.Node(uid), T: g.Node(vid), Lines: l}

graph/multi: use correct test for empty iterator