mirror of
https://github.com/restic/restic.git
synced 2026-11-11 22:31:30 +00:00
rebuild-index: Refactor a bit
This commit is contained in:
1 parent
5d617edbbf
commit
88849c06a6
2 files changed
+43
-20
No files matched your search
@@ -248,6 +248,15 @@ func (idx *Index) Count(t pack.BlobType) (n uint) {
|
||||
return
|
||||
}
|
||||
|
||||
// Length returns the number of entries in the Index.
|
||||
func (idx *Index) Length() uint {
|
||||
debug.Log("Index.Count", "counting blobs")
|
||||
idx.m.Lock()
|
||||
defer idx.m.Unlock()
|
||||
|
||||
return uint(len(idx.pack))
|
||||
}
|
||||
|
||||
type packJSON struct {
|
||||
ID backend.ID `json:"id"`
|
||||
Blobs []blobJSON `json:"blobs"`
|
||||
|
||||
Reference in new issue
Block a user