Skip to content

Commit

Permalink
chore: add size to map initialisation in convert.go
Browse files Browse the repository at this point in the history
  • Loading branch information
jmickey committed Oct 29, 2021
1 parent 17a465b commit 3348eae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions infrastructure/grpc/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func convertModelToMicroVMStatus(mvm *models.MicroVM) *types.MicroVMStatus {
converted.State = types.MicroVMStatus_FAILED
}

converted.Volumes = make(map[string]*types.VolumeStatus)
converted.Volumes = make(map[string]*types.VolumeStatus, len(mvm.Status.Volumes))
for volName, volStatus := range mvm.Status.Volumes {
converted.Volumes[volName] = convertModelToVolumeStatus(volStatus)
}
Expand All @@ -210,7 +210,7 @@ func convertModelToMicroVMStatus(mvm *models.MicroVM) *types.MicroVMStatus {
converted.InitrdMount = convertModelToVolumeMount(mvm.Status.InitrdMount)
}

converted.NetworkInterfaces = make(map[string]*types.NetworkInterfaceStatus)
converted.NetworkInterfaces = make(map[string]*types.NetworkInterfaceStatus, len(mvm.Status.NetworkInterfaces))
for netIfaceName, netIfaceStatus := range mvm.Status.NetworkInterfaces {
converted.NetworkInterfaces[netIfaceName] = convertModelToNetworkInterfaceStatus(netIfaceStatus)
}
Expand Down

0 comments on commit 3348eae

Please sign in to comment.