Skip to content

Commit

Permalink
fix generics type
Browse files Browse the repository at this point in the history
  • Loading branch information
ykadowak committed Sep 20, 2023
1 parent 6c22838 commit e1bae85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/net/grpc/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func BidirectionalStreamClient(stream ClientStream,
}()
}

func removeDuplicates[E comparable](x []E, less func(left, right E) int) []E {
func removeDuplicates[S ~[]E, E comparable](x S, less func(left, right E) int) S {
if len(x) < 2 {
return x
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/gateway/lb/handler/grpc/aggregation.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ func (v *valdPoolSliceAggr) Result() (res *payload.Search_Response) {
return res
}

func removeDuplicates[E comparable](x []E, less func(left, right E) int) []E {
func removeDuplicates[S ~[]E, E comparable](x S, less func(left, right E) int) S {
if len(x) < 2 {
return x
}
Expand Down

0 comments on commit e1bae85

Please sign in to comment.