chore: small fixes and cosmetic.

This commit is contained in:
Alexandre Pujol 2024-06-04 20:01:05 +01:00
parent 41c0e57eca
commit d98621625a
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
8 changed files with 14 additions and 17 deletions

View file

@ -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)
}
}