MCPcopy Index your code
hub / github.com/apache/answer / UniqueArray

Function UniqueArray

pkg/converter/array.go:36–46  ·  view source on GitHub ↗
(input []T)

Source from the content-addressed store, hash-verified

34}
35
36func UniqueArray[T comparable](input []T) []T {
37 result := make([]T, 0, len(input))
38 seen := make(map[T]bool, len(input))
39 for _, element := range input {
40 if !seen[element] {
41 result = append(result, element)
42 seen[element] = true
43 }
44 }
45 return result
46}

Callers 2

findFirstMatchedWordFunction · 0.92
parseTagsMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected