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.
2 parents 36ed1c5 + 88e0e4f commit 036d296Copy full SHA for 036d296
pkg/state/state.go
@@ -188,9 +188,7 @@ func (s *state) GetVolumeByName(volName string) (Volume, error) {
188
189
func (s *state) GetVolumes() []Volume {
190
volumes := make([]Volume, len(s.Volumes))
191
- for i, volume := range s.Volumes {
192
- volumes[i] = volume
193
- }
+ copy(volumes, s.Volumes)
194
return volumes
195
}
196
@@ -235,9 +233,7 @@ func (s *state) GetSnapshotByName(name string) (Snapshot, error) {
235
233
236
234
func (s *state) GetSnapshots() []Snapshot {
237
snapshots := make([]Snapshot, len(s.Snapshots))
238
- for i, snapshot := range s.Snapshots {
239
- snapshots[i] = snapshot
240
+ copy(snapshots, s.Snapshots)
241
return snapshots
242
243
0 commit comments