Merge pull request #9193 from Chocobo1/fix

Simplify code
This commit is contained in:
Mike Tzou 2018-07-17 00:01:31 +08:00 committed by GitHub
commit 59d70c8a96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2204,8 +2204,8 @@ bool Session::addTorrent_impl(CreateTorrentParams params, const MagnetUri &magne
// processed or adding to session
if (m_addingTorrents.contains(hash) || m_loadedMetadata.contains(hash)) return false;
if (m_torrents.contains(hash)) {
TorrentHandle *const torrent = m_torrents.value(hash);
TorrentHandle *const torrent = m_torrents.value(hash);
if (torrent) {
if (torrent->isPrivate() || (!fromMagnetUri && torrentInfo.isPrivate()))
return false;
torrent->addTrackers(fromMagnetUri ? magnetUri.trackers() : torrentInfo.trackers());