Skip to content

Commit

Permalink
lxd/storage/drivers/powerflex: Pre-allocate slices (linter)
Browse files Browse the repository at this point in the history
Signed-off-by: Din Music <[email protected]>
  • Loading branch information
MusicDin committed Jan 21, 2025
1 parent 2bd6ccd commit d3d3fa9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lxd/storage/drivers/driver_powerflex_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (d *powerflex) CreateVolumeFromCopy(vol VolumeCopy, srcVol VolumeCopy, allo
return nil
}

var srcVolumeSnapshots []string
srcVolumeSnapshots := make([]string, 0, len(vol.Snapshots))
for _, snapshot := range vol.Snapshots {
_, snapshotName, _ := api.GetParentAndSnapshotName(snapshot.name)
srcVolumeSnapshots = append(srcVolumeSnapshots, snapshotName)
Expand Down Expand Up @@ -999,7 +999,7 @@ func (d *powerflex) VolumeSnapshots(vol Volume, op *operations.Operation) ([]str
return nil, err
}

var snapshotNames []string
snapshotNames := make([]string, 0, len(volumeSnapshots))
for _, snapshot := range volumeSnapshots {
snapshotNames = append(snapshotNames, snapshot.Name)
}
Expand Down

0 comments on commit d3d3fa9

Please sign in to comment.