Merge pull request #5622 from yaohcn/fix-drop-sector

fix drop sector
This commit is contained in:
Łukasz Magiera 2021-02-19 12:08:28 +01:00 committed by GitHub
commit 4f6700a4ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,7 +232,7 @@ func (i *Index) StorageDropSector(ctx context.Context, storageID ID, s abi.Secto
d := Decl{s, fileType}
if len(i.sectors[d]) == 0 {
return nil
continue
}
rewritten := make([]*declMeta, 0, len(i.sectors[d])-1)
@ -245,7 +245,7 @@ func (i *Index) StorageDropSector(ctx context.Context, storageID ID, s abi.Secto
}
if len(rewritten) == 0 {
delete(i.sectors, d)
return nil
continue
}
i.sectors[d] = rewritten