Skip to content

Commit

Permalink
Fix suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocaylent committed Apr 5, 2024
1 parent 17ce6b4 commit deba1ea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions endpoint/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,16 +345,17 @@ type DNSEndpointList struct {
}

// RemoveDuplicates returns a slice holding the unique endpoints.
func RemoveDuplicates(filtered []*Endpoint) []*Endpoint {
func RemoveDuplicates(endpoints []*Endpoint) []*Endpoint {
visited := make(map[EndpointKey]struct{})
result := []*Endpoint{}

for _, ep := range filtered {
for _, ep := range endpoints {
key := ep.Key()

if _, found := visited[key]; !found {
result = append(result, ep)
visited[key] = struct{}{}
//visited[key] = struct{}{}
// Currently Debugging 0.14.0 to see the exact root cause
} else {
log.Debugf(`Skipping duplicated endpoint: %v`, ep)
}
Expand Down

0 comments on commit deba1ea

Please sign in to comment.