Fix name including package name and variable shadowing package.

This commit is contained in:
Martin Smith
2025-03-23 10:01:19 +00:00
parent 5e7333d28d
commit 6e45c51509
6 changed files with 24 additions and 24 deletions

View File

@@ -93,8 +93,8 @@ const (
indexMaxAge = 10 * time.Minute
)
// IndexFull returns true iff the index is "full enough" to be saved as a preliminary index.
var IndexFull = func(idx *Index) bool {
// Full returns true iff the index is "full enough" to be saved as a preliminary index.
var Full = func(idx *Index) bool {
idx.m.RLock()
defer idx.m.RUnlock()
@@ -119,7 +119,7 @@ var IndexFull = func(idx *Index) bool {
return false
}
var IndexOversized = func(idx *Index) bool {
var Oversized = func(idx *Index) bool {
idx.m.RLock()
defer idx.m.RUnlock()
@@ -258,8 +258,8 @@ func (idx *Index) EachByPack(ctx context.Context, packBlacklist restic.IDSet) <-
for packID, packByType := range byPack {
var result EachByPackResult
result.PackID = packID
for typ, pack := range packByType {
for _, e := range pack {
for typ, p := range packByType {
for _, e := range p {
result.Blobs = append(result.Blobs, idx.toPackedBlob(e, restic.BlobType(typ)).Blob)
}
}
@@ -511,10 +511,10 @@ func DecodeIndex(buf []byte, id restic.ID) (idx *Index, err error) {
}
idx = NewIndex()
for _, pack := range idxJSON.Packs {
packID := idx.addToPacks(pack.ID)
for _, p := range idxJSON.Packs {
packID := idx.addToPacks(p.ID)
for _, blob := range pack.Blobs {
for _, blob := range p.Blobs {
idx.store(packID, restic.Blob{
BlobHandle: restic.BlobHandle{
Type: blob.Type,