rebuild-index: Refactor a bit

This commit is contained in:
Alexander Neumann committed 2015-10-25 17:53:02 +01:00
1 parent 5d617edbbf
commit 88849c06a6
2 files changed
+43 -20

No files matched your search

+9
View File
@@ -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"`