~skuzzymiglet/feef

bf4c2b611efd1e36f466fea746d851dc30e3a7a0 — skuzzymiglet 1 year, 7 days ago 551b969
remove check for greater number of items - feeds that return a constant number of items will now not fall through
1 files changed, 7 insertions(+), 9 deletions(-)

M notify.go
M notify.go => notify.go +7 -9
@@ 10,16 10,14 @@ import (

func findNewItems(oldFeed, newFeed LinkedFeed) []LinkedFeedItem {
	var buf []LinkedFeedItem
	if len(newFeed.Items) > len(oldFeed.Items) {
		tmp := make(map[string]struct{}, len(newFeed.Items))
	tmp := make(map[string]struct{}, len(newFeed.Items))

		for _, i := range oldFeed.Items {
			tmp[i.GUID] = struct{}{}
		}
		for _, i := range newFeed.Items { // For each new...
			if _, found := tmp[i.GUID]; !found {
				buf = append(buf, i)
			}
	for _, i := range oldFeed.Items {
		tmp[i.GUID] = struct{}{}
	}
	for _, i := range newFeed.Items { // For each new...
		if _, found := tmp[i.GUID]; !found {
			buf = append(buf, i)
		}
	}
	return buf