mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 21:05:10 +00:00
Cleanup index code
The selectFn wasn't used any more, so remove it from generatePackList().
This commit is contained in:
parent
650eab6a0e
commit
2710d6399a
@ -233,10 +233,8 @@ type blobJSON struct {
|
||||
Length uint `json:"length"`
|
||||
}
|
||||
|
||||
// generatePackList returns a list of packs containing only the index entries
|
||||
// that selsectFn returned true for. If selectFn is nil, the list contains all
|
||||
// blobs in the index.
|
||||
func (idx *Index) generatePackList(selectFn func(indexEntry) bool) ([]*packJSON, error) {
|
||||
// generatePackList returns a list of packs.
|
||||
func (idx *Index) generatePackList() ([]*packJSON, error) {
|
||||
list := []*packJSON{}
|
||||
packs := make(map[backend.ID]*packJSON)
|
||||
|
||||
@ -245,10 +243,6 @@ func (idx *Index) generatePackList(selectFn func(indexEntry) bool) ([]*packJSON,
|
||||
panic("nil pack id")
|
||||
}
|
||||
|
||||
if selectFn != nil && !selectFn(blob) {
|
||||
continue
|
||||
}
|
||||
|
||||
debug.Log("Index.generatePackList", "handle blob %v", id.Str())
|
||||
|
||||
if blob.packID.IsNull() {
|
||||
@ -302,7 +296,7 @@ func (idx *Index) Encode(w io.Writer) error {
|
||||
func (idx *Index) encode(w io.Writer) error {
|
||||
debug.Log("Index.encode", "encoding index")
|
||||
|
||||
list, err := idx.generatePackList(nil)
|
||||
list, err := idx.generatePackList()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -332,7 +326,7 @@ func (idx *Index) Dump(w io.Writer) error {
|
||||
idx.m.Lock()
|
||||
defer idx.m.Unlock()
|
||||
|
||||
list, err := idx.generatePackList(nil)
|
||||
list, err := idx.generatePackList()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user