diff options
author | Santiago M. Mola <santi@mola.io> | 2017-07-25 10:08:36 +0200 |
---|---|---|
committer | Santiago M. Mola <santi@mola.io> | 2017-07-26 10:56:59 +0200 |
commit | c64eb817d5e5cbaec10dea1342e1ec95721e886b (patch) | |
tree | 952839005580551bf9042ded89e2dcda56d779fc /plumbing/format/idxfile/encoder.go | |
parent | fbf2a4ab4588c78e3d9d0265dba774ae6b388b5f (diff) | |
download | go-git-c64eb817d5e5cbaec10dea1342e1ec95721e886b.tar.gz |
packfile: create packfile.Index and reuse it
There was an internal type (i.e. storage/filesystem.idx) to
use as in-memory index for packfiles. This was not convenient
to reuse in the packfile.
This commit creates a new representation (format/packfile.Index)
that can be converted to and from idxfile.Idxfile.
A packfile.Index now contains the functionality that was scattered
on storage/filesystem.idx and packfile.Decoder's internals.
storage/filesystem now reuses packfile.Index instances and this
also results in higher cache hit ratios when resolving deltas.
Diffstat (limited to 'plumbing/format/idxfile/encoder.go')
-rw-r--r-- | plumbing/format/idxfile/encoder.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plumbing/format/idxfile/encoder.go b/plumbing/format/idxfile/encoder.go index 71e1b3f..d8f4d94 100644 --- a/plumbing/format/idxfile/encoder.go +++ b/plumbing/format/idxfile/encoder.go @@ -124,7 +124,7 @@ func (e *Encoder) encodeChecksums(idx *Idxfile) (int, error) { } // EntryList implements sort.Interface allowing sorting in increasing order. -type EntryList []Entry +type EntryList []*Entry func (p EntryList) Len() int { return len(p) } func (p EntryList) Less(i, j int) bool { return p[i].Hash.String() < p[j].Hash.String() } |