mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-25 15:50:20 +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))
|
err, string(content))
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, cluster := range config {
|
for i := range config {
|
||||||
if cluster.ClusterID == clusterID {
|
if config[i].ClusterID == clusterID {
|
||||||
return &cluster, nil
|
return &config[i], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user