Skip to content

Commit

Permalink
Merge pull request #988 from ish-hcc/fix_regionzone_handler_go_routine
Browse files Browse the repository at this point in the history
[+Region/Zone]  Remove a useless variable in RegionZoneHandler
  • Loading branch information
powerkimhub authored Dec 19, 2023
2 parents 7e341e0 + 22e3d0e commit e3aa16a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func (regionZoneHandler *AzureRegionZoneHandler) ListRegionZone() ([]*irs.Region
var mutex = &sync.Mutex{}
var lenLocations = len(*resultListLocations.Value)
var zoneErrorOccurred bool
k := 0

for i := 0; i < lenLocations; {
if lenLocations-i < routineMax {
Expand Down Expand Up @@ -119,9 +118,7 @@ func (regionZoneHandler *AzureRegionZoneHandler) ListRegionZone() ([]*irs.Region
mutex.Unlock()

wait.Done()
}(&wait, (*resultListLocations.Value)[k])

k++
}(&wait, (*resultListLocations.Value)[i])

i++
if i == lenLocations {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func (regionZoneHandler *IbmRegionZoneHandler) ListRegionZone() ([]*irs.RegionZo
var mutex = &sync.Mutex{}
var lenRegions = len(regions.Regions)
var zoneErrorOccurred bool
k := 0

for i := 0; i < lenRegions; {
if lenRegions-i < routineMax {
Expand Down Expand Up @@ -84,9 +83,7 @@ func (regionZoneHandler *IbmRegionZoneHandler) ListRegionZone() ([]*irs.RegionZo
mutex.Unlock()

wait.Done()
}(&wait, regions.Regions[k])

k++
}(&wait, regions.Regions[i])

i++
if i == lenRegions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func (regionZoneHandler *OpenStackRegionZoneHandler) ListRegionZone() ([]*irs.Re
var mutex = &sync.Mutex{}
var lenRegions = len(regionList)
var zoneErrorOccurred bool
k := 0

for i := 0; i < lenRegions; {
if lenRegions-i < routineMax {
Expand Down Expand Up @@ -121,9 +120,7 @@ func (regionZoneHandler *OpenStackRegionZoneHandler) ListRegionZone() ([]*irs.Re
mutex.Unlock()

wait.Done()
}(&wait, regionList[k])

k++
}(&wait, regionList[i])

i++
if i == lenRegions {
Expand Down

0 comments on commit e3aa16a

Please sign in to comment.