chore: small fixes and cosmetic.
This commit is contained in:
parent
41c0e57eca
commit
d98621625a
8 changed files with 14 additions and 17 deletions
|
|
@ -71,11 +71,11 @@ func DecodeHexInString(str string) string {
|
|||
func RemoveDuplicate[T comparable](inlist []T) []T {
|
||||
var empty T
|
||||
list := []T{}
|
||||
keys := map[T]bool{}
|
||||
keys[empty] = true
|
||||
seen := map[T]bool{}
|
||||
seen[empty] = true
|
||||
for _, item := range inlist {
|
||||
if _, ok := keys[item]; !ok {
|
||||
keys[item] = true
|
||||
if _, ok := seen[item]; !ok {
|
||||
seen[item] = true
|
||||
list = append(list, item)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue