From 4fa6c97010b302f1bfcd87e8aeffa5c7ba80044b Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Thu, 5 Dec 2013 13:53:57 +0100 Subject: [PATCH] Makes days map a global lookup table --- rss.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/rss.go b/rss.go index 4ff720f..c50a3a7 100644 --- a/rss.go +++ b/rss.go @@ -6,15 +6,17 @@ import ( xmlx "github.com/jteeuwen/go-pkg-xmlx" ) +var days = map[string]int{ + "Monday": 1, + "Tuesday": 2, + "Wednesday": 3, + "Thursday": 4, + "Friday": 5, + "Saturday": 6, + "Sunday": 7, +} + func (this *Feed) readRss2(doc *xmlx.Document) (err error) { - days := make(map[string]int) - days["Monday"] = 1 - days["Tuesday"] = 2 - days["Wednesday"] = 3 - days["Thursday"] = 4 - days["Friday"] = 5 - days["Saturday"] = 6 - days["Sunday"] = 7 getChan := func(pubdate, title string) *Channel { for _, c := range this.Channels {