diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-02-21 16:03:39 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-02-21 16:03:39 +0100 |
commit | ed288b30de1ac3dcb3ce675c4b9af89eb4e6fcba (patch) | |
tree | 6eb908b839d6c225d95691d91e3d5ef5220f54c1 /plumbing/format/index | |
parent | d6a6decd1be0515faf36256ce06c58c7d662bbd0 (diff) | |
download | go-git-ed288b30de1ac3dcb3ce675c4b9af89eb4e6fcba.tar.gz |
documentation and API improvements
Diffstat (limited to 'plumbing/format/index')
-rw-r--r-- | plumbing/format/index/encoder.go | 10 |
1 files changed, 5 insertions, 5 deletions
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 } |