From 17d1bb7ddec5044fe35a73159f8ef4f41ab2abeb Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 20 Oct 2014 23:14:14 -0700 Subject: [PATCH] Revert "Merge pull request #422 from svanharmelen/f-shaving-off-some-cpu-cycles" This reverts commit 428cce2478aeb0e091d125e7808aaad42199faf0, reversing changes made to 517c5b2ea82b22f2275d1522fcf6ea48f1919026. --- helper/schema/resource_data.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/helper/schema/resource_data.go b/helper/schema/resource_data.go index 3e728389d..cdc0d82d2 100644 --- a/helper/schema/resource_data.go +++ b/helper/schema/resource_data.go @@ -349,10 +349,12 @@ func (d *ResourceData) getSet( var indexMap map[int]int if len(parts) > 0 { indexMap = make(map[int]int) + } - // Build the set from all the items using the given hash code - for i, v := range list { - code := s.add(v) + // Build the set from all the items using the given hash code + for i, v := range list { + code := s.add(v) + if indexMap != nil { indexMap[code] = i } }