code refactor in torrent_handle::info_hash

This commit is contained in:
Alden Torres 2017-09-24 19:29:05 -04:00 committed by Arvid Norberg
parent a619dfb996
commit 45fe6c0110
1 changed files with 1 additions and 3 deletions

View File

@ -180,9 +180,7 @@ namespace libtorrent {
sha1_hash torrent_handle::info_hash() const
{
std::shared_ptr<torrent> t = m_torrent.lock();
static const sha1_hash empty;
if (!t) return empty;
return t->info_hash();
return t ? t->info_hash() : sha1_hash();
}
int torrent_handle::max_uploads() const