fix V821 Decreased performance. (#2675)
The 't' variable can be constructed in a lower level scope
This commit is contained in:
parent
3e29968a92
commit
97ceeab9e3
|
@ -414,13 +414,18 @@ namespace {
|
|||
|
||||
if (!m_supports_fast) return;
|
||||
|
||||
#if TORRENT_USE_ASSERTS
|
||||
std::shared_ptr<torrent> t = associated_torrent().lock();
|
||||
TORRENT_ASSERT(t);
|
||||
TORRENT_ASSERT(t->valid_metadata());
|
||||
#endif
|
||||
|
||||
#ifndef TORRENT_DISABLE_LOGGING
|
||||
if (should_log(peer_log_alert::outgoing_message))
|
||||
{
|
||||
#if !TORRENT_USE_ASSERTS
|
||||
std::shared_ptr<torrent> t = associated_torrent().lock();
|
||||
#endif
|
||||
peer_log(peer_log_alert::outgoing_message, "SUGGEST"
|
||||
, "piece: %d num_peers: %d", static_cast<int>(piece)
|
||||
, t->has_picker() ? t->picker().get_availability(piece) : -1);
|
||||
|
|
Loading…
Reference in New Issue