From 913f9a923e0020ca64284e905f1d4f1a45d8b546 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 15 Dec 2014 17:39:07 -0800 Subject: [PATCH] helper/schema: remove unnecessary code --- helper/schema/schema.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/helper/schema/schema.go b/helper/schema/schema.go index b85f1c19a..410bab583 100644 --- a/helper/schema/schema.go +++ b/helper/schema/schema.go @@ -575,7 +575,7 @@ func (m schemaMap) diffMap( // First get all the values from the state var stateMap, configMap map[string]string - o, n, _, computedMap := d.diffChange(k) + o, n, _, _ := d.diffChange(k) if err := mapstructure.WeakDecode(o, &stateMap); err != nil { return fmt.Errorf("%s: %s", k, err) } @@ -583,21 +583,9 @@ func (m schemaMap) diffMap( return fmt.Errorf("%s: %s", k, err) } - // Get the counts - oldLen, newLen := len(stateMap), len(configMap) - oldStr := strconv.FormatInt(int64(oldLen), 10) - - // If the whole map is computed, then just say the # is computed and exit. - if computedMap { - diff.Attributes[k+".#"] = &terraform.ResourceAttrDiff{ - Old: oldStr, - NewComputed: true, - } - return nil - } - // Check if the number of elements has changed. If we're computing // a list and there isn't a config, then it hasn't changed. + oldLen, newLen := len(stateMap), len(configMap) changed := oldLen != newLen if oldLen != 0 && newLen == 0 && schema.Computed { changed = false @@ -610,6 +598,7 @@ func (m schemaMap) diffMap( ForceNew: schema.ForceNew, } + oldStr := strconv.FormatInt(int64(oldLen), 10) newStr := "" if !computed { newStr = strconv.FormatInt(int64(newLen), 10)