mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Merge 61ce39508d
into 95eb6c1230
This commit is contained in:
commit
9d5d8992b7
1 changed files with 12 additions and 4 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue