🎨 Update av

This commit is contained in:
Daniel 2023-07-03 21:16:38 +08:00
parent 4041c509f6
commit 919cd04c8a
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 13 additions and 21 deletions

View file

@ -24,18 +24,6 @@ import (
"github.com/88250/lute/html"
)
// RemoveDuplicatedElem removes the duplicated elements from the slice.
func RemoveDuplicatedElem(slice []int) (ret []int) {
allKeys := make(map[int]bool)
for _, item := range slice {
if _, value := allKeys[item]; !value {
allKeys[item] = true
ret = append(ret, item)
}
}
return
}
// InsertElem inserts a new element value at the specified index position.
// 0 <= index <= len(a)
func InsertElem[T any](ret []T, index int, value T) []T {