diff options
Diffstat (limited to '')
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | internal/feed/cache/v1.go | 8 |
2 files changed, 2 insertions, 8 deletions
@@ -1,6 +1,6 @@ module github.com/Necoro/feed2imap-go -go 1.20 +go 1.21 require ( github.com/Necoro/gofeed v1.2.2-0.20230305145438-f7a233d95a2f diff --git a/internal/feed/cache/v1.go b/internal/feed/cache/v1.go index 7d0d11b..4e3f3e2 100644 --- a/internal/feed/cache/v1.go +++ b/internal/feed/cache/v1.go @@ -356,13 +356,7 @@ CACHE_ITEMS: } func filterItems(items []cachedItem) []cachedItem { - var n int - - if len(items) < maxCacheSize { - n = len(items) - } else { - n = maxCacheSize - } + n := min(len(items), maxCacheSize) copiedItems := make([]cachedItem, 0, n) for _, item := range items { |