We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0048ab7 commit 88e0e4fCopy full SHA for 88e0e4f
pkg/state/state.go
@@ -189,9 +189,7 @@ func (s *state) GetVolumeByName(volName string) (Volume, error) {
189
190
func (s *state) GetVolumes() []Volume {
191
volumes := make([]Volume, len(s.Volumes))
192
- for i, volume := range s.Volumes {
193
- volumes[i] = volume
194
- }
+ copy(volumes, s.Volumes)
195
return volumes
196
}
197
@@ -236,9 +234,7 @@ func (s *state) GetSnapshotByName(name string) (Snapshot, error) {
236
234
237
235
func (s *state) GetSnapshots() []Snapshot {
238
snapshots := make([]Snapshot, len(s.Snapshots))
239
- for i, snapshot := range s.Snapshots {
240
- snapshots[i] = snapshot
241
+ copy(snapshots, s.Snapshots)
242
return snapshots
243
244
0 commit comments