MCPcopy Index your code
hub / github.com/gotify/server / uniq

Function uniq

api/stream/stream.go:171–181  ·  view source on GitHub ↗
(s []T)

Source from the content-addressed store, hash-verified

169}
170
171func uniq[T comparable](s []T) []T {
172 m := make(map[T]struct{}, len(s))
173 r := make([]T, 0, len(s))
174 for _, v := range s {
175 if _, ok := m[v]; !ok {
176 m[v] = struct{}{}
177 r = append(r, v)
178 }
179 }
180 return r
181}
182
183func isAllowedOrigin(r *http.Request, allowedOrigins []*regexp.Regexp) bool {
184 origin := r.Header.Get("origin")

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…