@@ -40,15 +40,15 @@ func (src *Object) ConvertTo(dstRaw conversion.Hub) error {
4040 },
4141 }
4242
43- connectionDetails := []v1alpha2.ConnectionDetail {}
43+ connectionDetails := make ( []v1alpha2.ConnectionDetail , 0 , len ( src . Spec . ConnectionDetails ))
4444 for _ , cd := range src .Spec .ConnectionDetails {
4545 connectionDetails = append (connectionDetails , v1alpha2.ConnectionDetail {
4646 ObjectReference : cd .ObjectReference ,
4747 ToConnectionSecretKey : cd .ToConnectionSecretKey ,
4848 })
4949 }
5050
51- references := []v1alpha2.Reference {}
51+ references := make ( []v1alpha2.Reference , 0 , len ( src . Spec . References ))
5252 for _ , r := range src .Spec .References {
5353 ref := v1alpha2.Reference {}
5454 if r .DependsOn != nil {
@@ -120,15 +120,15 @@ func (dst *Object) ConvertFrom(srcRaw conversion.Hub) error { //nolint:gocyclo /
120120 },
121121 }
122122
123- connectionDetails := []ConnectionDetail {}
123+ connectionDetails := make ( []ConnectionDetail , 0 , len ( src . Spec . ConnectionDetails ))
124124 for _ , cd := range src .Spec .ConnectionDetails {
125125 connectionDetails = append (connectionDetails , ConnectionDetail {
126126 ObjectReference : cd .ObjectReference ,
127127 ToConnectionSecretKey : cd .ToConnectionSecretKey ,
128128 })
129129 }
130130
131- references := []Reference {}
131+ references := make ( []Reference , 0 , len ( src . Spec . References ))
132132 for _ , r := range src .Spec .References {
133133 ref := Reference {}
134134 if r .DependsOn != nil {
0 commit comments