Skip to content

Commit 10d116f

Browse files
committed
changed back to for loop from range
1 parent 2c66d63 commit 10d116f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

npm/pkg/dataplane/dataplane_windows.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,14 @@ func (dp *DataPlane) getLocalPodEndpoints() ([]*hcn.HostComputeEndpoint, error)
378378
func GetUniqueEndpoints(endpoints, endpointsAttached []hcn.HostComputeEndpoint) []hcn.HostComputeEndpoint {
379379
// Store IDs of endpoints list in a map for quick lookup
380380
idMap := make(map[string]struct{}, len(endpoints))
381-
for _, ep := range endpoints {
381+
for i := 0; i < len(endpoints); i++ {
382+
ep := endpoints[i]
382383
idMap[ep.Id] = struct{}{}
383384
}
384385

385386
// Add endpointsAttached list endpoints in endpoints list if the endpoint is not in the map
386-
for _, ep := range endpointsAttached {
387+
for i := 0; i < len(endpointsAttached); i++ {
388+
ep := endpointsAttached[i]
387389
if _, ok := idMap[ep.Id]; !ok {
388390
endpoints = append(endpoints, ep)
389391
}

0 commit comments

Comments
 (0)