Added arrays to XMLProvider types for faster iteration

This commit is contained in:
Simon Martens
2024-12-20 19:54:25 +01:00
parent 3ef30ef7c7
commit 977d7331d5
11 changed files with 188 additions and 122 deletions

View File

@@ -29,7 +29,11 @@ type Additional struct {
Bis int `xml:"bis"`
}
func (i Issue) GetIDs() []string {
func (i Issue) Keys() []string {
if len(i.keys) > 0 {
return i.keys
}
res := make([]string, 2)
date := i.Datum.When
if date != "" {
@@ -40,6 +44,8 @@ func (i Issue) GetIDs() []string {
res = append(res, i.Datum.When[0:4]+"-"+strconv.Itoa(i.Number.No))
}
i.keys = res
return res
}