simplify index code

This commit is contained in:
Michael Eischer authored and Alexander Weiss committed 2020-06-14 07:50:19 +02:00
1 parent 7419844885
commit d92e2c5769
2 files changed
+16 -42

No files matched your search

-13
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()