mirror of
https://github.com/octoleo/restic.git
synced 2024-12-24 11:55:28 +00:00
Delete Index.Remove()
This commit is contained in:
parent
4b2a4b03ec
commit
941b7025b6
@ -70,22 +70,6 @@ func (idx *Index) Store(t pack.BlobType, id backend.ID, pack *backend.ID, offset
|
|||||||
idx.store(t, id, pack, offset, length)
|
idx.store(t, id, pack, offset, length)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove removes the pack ID from the index.
|
|
||||||
func (idx *Index) Remove(packID backend.ID) {
|
|
||||||
idx.m.Lock()
|
|
||||||
defer idx.m.Unlock()
|
|
||||||
|
|
||||||
if idx.final {
|
|
||||||
panic("remove item from finalized index")
|
|
||||||
}
|
|
||||||
|
|
||||||
debug.Log("Index.Remove", "id %v removed", packID.Str())
|
|
||||||
|
|
||||||
if _, ok := idx.pack[packID]; ok {
|
|
||||||
delete(idx.pack, packID)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lookup returns the pack for the id.
|
// Lookup returns the pack for the id.
|
||||||
func (idx *Index) Lookup(id backend.ID) (packID *backend.ID, tpe pack.BlobType, offset, length uint, err error) {
|
func (idx *Index) Lookup(id backend.ID) (packID *backend.ID, tpe pack.BlobType, offset, length uint, err error) {
|
||||||
idx.m.Lock()
|
idx.m.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user