// Unique creates a new slice without duplicate values.
Unique creates a new slice without duplicate values.
// Unique creates a new slice without duplicate values .
func Unique(s []int64) Int64s {
	m := Int64s(make([]int64, 0, len(s)))
	seen := make(map[int64]struct{})
	for _, v := range s {
		if _, ok := seen[v]; !ok {
			m = append(m, v)
			seen[v] = struct{}{}
		}
	}
	return m
}
func Unique ( s [ ] int64 ) Int64s { m := Int64s ( make ( [ ] int64 , 0 , len ( s ) ) ) seen := make ( map [ int64 ] struct { } ) for _ , v := range s { if _ , ok := seen [ v ] ; ! ok { m = append ( m , v ) seen [ v ] = struct { } { } } } return m }
Unique creates a new slice without duplicate values.
Unique creates a new slice without duplicate values .