From bdeb278728e1c8cc33535a2e6b5dff489addd852 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 24 May 2014 13:58:33 -0700 Subject: [PATCH] config: simplify --- config/config.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/config/config.go b/config/config.go index a787d574d..b4ada4ed1 100644 --- a/config/config.go +++ b/config/config.go @@ -68,16 +68,12 @@ func (r *Resource) Id() string { // ResourceGraph returns a dependency graph of the resources from this // Terraform configuration. func (c *Config) ResourceGraph() *depgraph.Graph { - resource2Noun := func(r *Resource) *depgraph.Noun { - return &depgraph.Noun{ + nouns := make(map[string]*depgraph.Noun) + for _, r := range c.Resources { + noun := &depgraph.Noun{ Name: r.Id(), Meta: r, } - } - - nouns := make(map[string]*depgraph.Noun) - for _, r := range c.Resources { - noun := resource2Noun(r) nouns[noun.Name] = noun }