Skip to content

Commit

Permalink
reduce method footprint
Browse files Browse the repository at this point in the history
  • Loading branch information
anuptalwalkar committed May 17, 2017
1 parent 16581fc commit cb604a3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions internal/graph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (g *Graph) ValidateReturnTypes(ctype reflect.Type, checkCachedObjects bool)
objType := ctype.Out(i)
if _, ok := g.nodes[objType]; ok {
if checkCachedObjects {
if g.checkCachedObjects(objType) {
if obj, ok := g.nodes[objType].(*objNode); ok && obj.cached {
return errors.Wrapf(errRetNode, "ctor: %v, object type: %v", ctype, objType)
}
} else {
Expand All @@ -160,11 +160,6 @@ func (g *Graph) ValidateReturnTypes(ctype reflect.Type, checkCachedObjects bool)
return nil
}

func (g *Graph) checkCachedObjects(objType reflect.Type) bool {
obj, ok := g.nodes[objType].(*objNode)
return ok && obj.cached
}

// DFS and tracking if same node is visited twice
func (g *Graph) recursiveDetectCycles(n graphNode, l []string) error {
for _, el := range l {
Expand Down

0 comments on commit cb604a3

Please sign in to comment.