1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00
This commit is contained in:
July 2025-06-24 05:52:52 -04:00 committed by GitHub
commit 9d5d8992b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,7 +8,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"log/slog" "log/slog"
"slices"
"strings" "strings"
"time" "time"
@ -630,9 +629,18 @@ func (s *Storage) UnshareEntry(userID int64, entryID int64) (err error) {
return return
} }
func removeDuplicates(l []string) []string { // removeDuplicate removes duplicate entries from a slice while keeping order.
slices.Sort(l) // Some feeds expect tags to be shown in order, so we preserve it rather than sort.
return slices.Compact(l) func removeDuplicates[T string | int](sliceList []T) []T {
allKeys := make(map[T]bool)
list := []T{}
for _, item := range sliceList {
if _, value := allKeys[item]; !value {
allKeys[item] = true
list = append(list, item)
}
}
return list
} }
func removeEmpty(l []string) []string { func removeEmpty(l []string) []string {