aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/cache
diff options
context:
space:
mode:
Diffstat (limited to 'internal/feed/cache')
-rw-r--r--internal/feed/cache/v1.go8
1 files changed, 1 insertions, 7 deletions
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 {