From d51e132c6432f2c1bbff5d9516f77375bb5252e6 Mon Sep 17 00:00:00 2001 From: Kurt Jung Date: Sun, 11 Oct 2015 21:06:01 -0400 Subject: Conditionally order another map iteration. Fix 'go vet' problem with unkeyed field in composite literal. --- fpdf.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'fpdf.go') diff --git a/fpdf.go b/fpdf.go index 08bcb2e..74489de 100644 --- a/fpdf.go +++ b/fpdf.go @@ -3367,21 +3367,10 @@ func (f *Fpdf) putxobjectdict() { } } { - var key int64 var keyList []int64 + var key int64 var tpl Template - for key = range f.templates { - keyList = append(keyList, key) - } - if f.catalogSort { - gensort(len(keyList), - func(a, b int) bool { - return keyList[a] < keyList[b] - }, - func(a, b int) { - keyList[a], keyList[b] = keyList[b], keyList[a] - }) - } + keyList = templateKeyList(f.templates, f.catalogSort) for _, key = range keyList { tpl = f.templates[key] // for _, tpl := range f.templates { -- cgit v1.2.1-24-ge1ad