From ed288b30de1ac3dcb3ce675c4b9af89eb4e6fcba Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Tue, 21 Feb 2017 16:03:39 +0100 Subject: documentation and API improvements --- plumbing/format/index/encoder.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plumbing/format') diff --git a/plumbing/format/index/encoder.go b/plumbing/format/index/encoder.go index 4699d43..bdb10c1 100644 --- a/plumbing/format/index/encoder.go +++ b/plumbing/format/index/encoder.go @@ -62,7 +62,7 @@ func (e *Encoder) encodeHeader(idx *Index) error { } func (e *Encoder) encodeEntries(idx *Index) error { - sort.Sort(ByName(idx.Entries)) + sort.Sort(byName(idx.Entries)) for _, entry := range idx.Entries { if err := e.encodeEntry(&entry); err != nil { @@ -143,8 +143,8 @@ func (e *Encoder) encodeFooter() error { return binary.Write(e.w, e.hash.Sum(nil)) } -type ByName []Entry +type byName []Entry -func (l ByName) Len() int { return len(l) } -func (l ByName) Swap(i, j int) { l[i], l[j] = l[j], l[i] } -func (l ByName) Less(i, j int) bool { return l[i].Name < l[j].Name } +func (l byName) Len() int { return len(l) } +func (l byName) Swap(i, j int) { l[i], l[j] = l[j], l[i] } +func (l byName) Less(i, j int) bool { return l[i].Name < l[j].Name } -- cgit