mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🎨 Update av
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user