aboutsummaryrefslogtreecommitdiff
path: root/internal/reader/opml/serializer.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/reader/opml/serializer.go')
-rw-r--r--internal/reader/opml/serializer.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/reader/opml/serializer.go b/internal/reader/opml/serializer.go
index b1638e4c..2ecccbed 100644
--- a/internal/reader/opml/serializer.go
+++ b/internal/reader/opml/serializer.go
@@ -38,14 +38,14 @@ func convertSubscriptionsToOPML(subscriptions SubcriptionList) *opmlDocument {
opmlDocument.Header.DateCreated = time.Now().Format("Mon, 02 Jan 2006 15:04:05 MST")
groupedSubs := groupSubscriptionsByFeed(subscriptions)
- var categories []string
+ categories := make([]string, 0, len(groupedSubs))
for k := range groupedSubs {
categories = append(categories, k)
}
sort.Strings(categories)
for _, categoryName := range categories {
- category := opmlOutline{Text: categoryName}
+ category := opmlOutline{Text: categoryName, Outlines: make(opmlOutlineCollection, 0, len(groupedSubs[categoryName]))}
for _, subscription := range groupedSubs[categoryName] {
category.Outlines = append(category.Outlines, opmlOutline{
Title: subscription.Title,