in torrent_handle::id(), only shift down the pointer by 10 bits

This commit is contained in:
arvidn 2018-07-28 08:42:33 +02:00 committed by Arvid Norberg
parent 2f56fa6c3e
commit c92f527b60
1 changed files with 3 additions and 3 deletions

View File

@ -1307,9 +1307,9 @@ namespace libtorrent
boost::uint32_t id() const
{
uintptr_t ret = reinterpret_cast<uintptr_t>(m_torrent.lock().get());
// a torrent object is about 1024 bytes, so
// it's safe to shift 11 bits
return boost::uint32_t(ret >> 11);
// a torrent object is about 1024 (2^10) bytes, so
// it's safe to shift 10 bits
return boost::uint32_t(ret >> 10);
}
// This function is intended only for use by plugins and the alert