File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -35,18 +35,20 @@ func TFValueToString(val attr.Value) string {
35
35
// TFListToStringSlice converts a types.List to a []string by calling
36
36
// tfValueToString on each element.
37
37
func TFListToStringSlice (l types.List ) []string {
38
- var ss []string
39
- for _ , el := range l .Elements () {
40
- ss = append (ss , TFValueToString (el ))
38
+ els := l .Elements ()
39
+ ss := make ([]string , len (els ))
40
+ for idx , el := range els {
41
+ ss [idx ] = TFValueToString (el )
41
42
}
42
43
return ss
43
44
}
44
45
45
46
// TFMapToStringMap converts a types.Map to a map[string]string by calling
46
47
// tfValueToString on each element.
47
48
func TFMapToStringMap (m types.Map ) map [string ]string {
48
- res := make (map [string ]string )
49
- for k , v := range m .Elements () {
49
+ els := m .Elements ()
50
+ res := make (map [string ]string , len (els ))
51
+ for k , v := range els {
50
52
res [k ] = TFValueToString (v )
51
53
}
52
54
return res
You can’t perform that action at this time.
0 commit comments