simplify index code

This commit is contained in:
Michael Eischer
2020-02-08 20:51:50 +01:00
committed by Alexander Weiss
parent 7419844885
commit d92e2c5769
2 changed files with 16 additions and 42 deletions

View File

@@ -132,19 +132,6 @@ func (mi *MasterIndex) Insert(idx *Index) {
mi.idx = append(mi.idx, idx)
}
// Remove deletes an index from the MasterIndex.
func (mi *MasterIndex) Remove(index *Index) {
mi.idxMutex.Lock()
defer mi.idxMutex.Unlock()
for i, idx := range mi.idx {
if idx == index {
mi.idx = append(mi.idx[:i], mi.idx[i+1:]...)
return
}
}
}
// Store remembers the id and pack in the index.
func (mi *MasterIndex) StorePack(id restic.ID, blobs []restic.Blob) {
mi.idxMutex.Lock()