mirror of
https://github.com/restic/restic.git
synced 2026-11-22 05:14:23 +00:00
index: convert to implement modern go iterators
This commit is contained in:
1 parent
0624b656b8
commit
38c543457e
11 files changed
+124
-101
No files matched your search
@@ -1,7 +1,6 @@
|
||||
package index
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sort"
|
||||
|
||||
"github.com/restic/restic/internal/restic"
|
||||
@@ -120,17 +119,17 @@ func (a *AssociatedSet[T]) For(cb func(bh restic.BlobHandle, val T)) {
|
||||
cb(k, v)
|
||||
}
|
||||
|
||||
_ = a.idx.Each(context.Background(), func(pb restic.PackedBlob) {
|
||||
for pb := range a.idx.Values() {
|
||||
if _, ok := a.overflow[pb.BlobHandle]; ok {
|
||||
// already reported via overflow set
|
||||
return
|
||||
continue
|
||||
}
|
||||
|
||||
val, known := a.Get(pb.BlobHandle)
|
||||
if known {
|
||||
cb(pb.BlobHandle, val)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// List returns a sorted slice of all BlobHandle in the set.
|
||||
|
||||
Reference in new issue
Block a user