(ss ...[]T)
| 6 | ) |
| 7 | |
| 8 | func UniqueJoin[T cmp.Ordered](ss ...[]T) []T { |
| 9 | var length int |
| 10 | for _, s := range ss { |
| 11 | length += len(s) |
| 12 | } |
| 13 | r := make([]T, length) |
| 14 | var i int |
| 15 | for _, s := range ss { |
| 16 | i += copy(r[i:], s) |
| 17 | } |
| 18 | slices.Sort(r) |
| 19 | return slices.Compact(r) |
| 20 | } |
| 21 | |
| 22 | func Convert[T, U any](s []T, f func(T) U) []U { |
| 23 | // Create a new slice with the same length as the input slice |
no outgoing calls
no test coverage detected
searching dependent graphs…