Remove unnecessary guard around delete

This commit is contained in:
deepsource-autofix[bot]
2021-05-03 19:40:36 +00:00
committed by GitHub
parent 22c17f2a5c
commit 99fa7301cb
2 changed files with 2 additions and 6 deletions

View File

@@ -359,9 +359,7 @@ func (t *Torrent) Close() {
t.Stat = state.TorrentClosed
t.bt.mu.Lock()
if _, ok := t.bt.torrents[t.Hash()]; ok {
delete(t.bt.torrents, t.Hash())
}
delete(t.bt.torrents, t.Hash())
t.bt.mu.Unlock()
t.drop()