summaryrefslogtreecommitdiff
path: root/sent.go
diff options
context:
space:
mode:
Diffstat (limited to 'sent.go')
-rw-r--r--sent.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/sent.go b/sent.go
index dc16051..dd3c4c4 100644
--- a/sent.go
+++ b/sent.go
@@ -43,6 +43,21 @@ func removeAlreadySent(fetched []flat, sent []flat) []flat {
return recent
}
+func removeDelisted(sent []flat, allFlats []flat) []flat {
+ if !slices.IsSortedFunc(allFlats, compareID) {
+ panic("allFlats expected to be sorted")
+ }
+ recent := make([]flat, 0)
+ for _, f := range sent {
+ _, found := slices.BinarySearchFunc(allFlats, f, compareID)
+ if !found {
+ continue
+ }
+ recent = append(recent, f)
+ }
+ return recent
+}
+
func writeSent(sent []flat, filename string) error {
jsonData, err := json.Marshal(sent)
if err != nil {