Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
minor simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Apr 16, 2021
1 parent e8baca4 commit f16239e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,11 @@ func (e *Engine) DeleteTorrent(infohash string) error {
if !t.Deleted {
close(t.dropWait)
t.Deleted = true
t.t.Drop()
}
delete(e.ts, t.InfoHash)
e.Unlock()

ih := metainfo.NewHashFromHex(infohash)
if tt, ok := e.client.Torrent(ih); ok {
tt.Drop()
}

e.removeMagnetCache(infohash)
e.removeTorrentCache(infohash)
return nil
Expand Down

0 comments on commit f16239e

Please sign in to comment.