mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
cleanup: use index instead of value while iterating
This commit cleans up for loop to use index to access value instead of copying value into a new variable while iterating. ``` internal/util/csiconfig.go:103:2: rangeValCopy: each \ iteration copies 136 bytes (consider pointers or indexing) \ (gocritic) for _, cluster := range config { ``` Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
parent
48d66d6cfd
commit
d39d2cffcc
@ -100,9 +100,9 @@ func readClusterInfo(pathToConfig, clusterID string) (*ClusterInfo, error) {
|
||||
err, string(content))
|
||||
}
|
||||
|
||||
for _, cluster := range config {
|
||||
if cluster.ClusterID == clusterID {
|
||||
return &cluster, nil
|
||||
for i := range config {
|
||||
if config[i].ClusterID == clusterID {
|
||||
return &config[i], nil
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user