forked from External/ergo
clean up force-trailing logic
This commit is contained in:
parent
38a6d17ee5
commit
60af8ee491
3 changed files with 25 additions and 19 deletions
|
|
@ -20,6 +20,14 @@ func (s HashSet[T]) Remove(elem T) {
|
|||
delete(s, elem)
|
||||
}
|
||||
|
||||
func SetLiteral[T comparable](elems ...T) HashSet[T] {
|
||||
result := make(HashSet[T], len(elems))
|
||||
for _, elem := range elems {
|
||||
result.Add(elem)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func CopyMap[K comparable, V any](input map[K]V) (result map[K]V) {
|
||||
result = make(map[K]V, len(input))
|
||||
for key, value := range input {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue