Skip to content

Commit 61d2658

Browse files
committed
fix preallocate arrays
1 parent c0757a9 commit 61d2658

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/services/baremetal/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,12 +529,12 @@ func ResourceServerRead(ctx context.Context, d *schema.ResourceData, m interface
529529

530530
_ = d.Set("private_network", flattenPrivateNetworks(pnRegion, listPrivateNetworks.ServerPrivateNetworks))
531531

532-
privateNetworkIDs := make([]string, listPrivateNetworks.TotalCount)
532+
privateNetworkIDs := make([]string, 0, listPrivateNetworks.TotalCount)
533533
for _, pn := range listPrivateNetworks.ServerPrivateNetworks {
534534
privateNetworkIDs = append(privateNetworkIDs, pn.PrivateNetworkID)
535535
}
536536

537-
allPrivateIPs := make([]map[string]interface{}, listPrivateNetworks.TotalCount)
537+
allPrivateIPs := make([]map[string]interface{}, 0, listPrivateNetworks.TotalCount)
538538
diags := diag.Diagnostics{}
539539

540540
for _, privateNetworkID := range privateNetworkIDs {

0 commit comments

Comments
 (0)