mirror of https://github.com/restic/restic.git
Remove dead code
This commit is contained in:
parent
7e732dbd2d
commit
35e3762e37
|
@ -111,22 +111,6 @@ func (idx *Index) Store(blob PackedBlob) {
|
||||||
idx.store(blob)
|
idx.store(blob)
|
||||||
}
|
}
|
||||||
|
|
||||||
// StoreBlobs saves information about the blobs to the index in one atomic transaction.
|
|
||||||
func (idx *Index) StoreBlobs(blobs []PackedBlob) {
|
|
||||||
idx.m.Lock()
|
|
||||||
defer idx.m.Unlock()
|
|
||||||
|
|
||||||
if idx.final {
|
|
||||||
panic("store new item in finalized index")
|
|
||||||
}
|
|
||||||
|
|
||||||
debug.Log("Index.StoreBlobs", "stored %d blobs", len(blobs))
|
|
||||||
|
|
||||||
for _, blob := range blobs {
|
|
||||||
idx.store(blob)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lookup queries the index for the blob ID and returns a PackedBlob.
|
// Lookup queries the index for the blob ID and returns a PackedBlob.
|
||||||
func (idx *Index) Lookup(id backend.ID) (pb PackedBlob, err error) {
|
func (idx *Index) Lookup(id backend.ID) (pb PackedBlob, err error) {
|
||||||
idx.m.Lock()
|
idx.m.Lock()
|
||||||
|
@ -193,22 +177,6 @@ func (idx *Index) LookupSize(id backend.ID) (cleartextLength uint, err error) {
|
||||||
return blob.PlaintextLength(), nil
|
return blob.PlaintextLength(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge loads all items from other into idx.
|
|
||||||
func (idx *Index) Merge(other *Index) {
|
|
||||||
debug.Log("Index.Merge", "Merge index with %p", other)
|
|
||||||
idx.m.Lock()
|
|
||||||
defer idx.m.Unlock()
|
|
||||||
|
|
||||||
for k, v := range other.pack {
|
|
||||||
if _, ok := idx.pack[k]; ok {
|
|
||||||
debug.Log("Index.Merge", "index already has key %v, updating", k.Str())
|
|
||||||
}
|
|
||||||
|
|
||||||
idx.pack[k] = v
|
|
||||||
}
|
|
||||||
debug.Log("Index.Merge", "done merging index")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Supersedes returns the list of indexes this index supersedes, if any.
|
// Supersedes returns the list of indexes this index supersedes, if any.
|
||||||
func (idx *Index) Supersedes() backend.IDs {
|
func (idx *Index) Supersedes() backend.IDs {
|
||||||
return idx.supersedes
|
return idx.supersedes
|
||||||
|
|
Loading…
Reference in New Issue