mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Update av
This commit is contained in:
parent
4041c509f6
commit
919cd04c8a
2 changed files with 13 additions and 21 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue