diff --git a/src/ut_metadata.cpp b/src/ut_metadata.cpp index 107982c87..1dfaae9ed 100644 --- a/src/ut_metadata.cpp +++ b/src/ut_metadata.cpp @@ -482,8 +482,7 @@ namespace libtorrent {namespace { std::shared_ptr ut_metadata_plugin::new_connection( peer_connection_handle const& pc) { - if (pc.type() != connection_type::bittorrent) - return std::shared_ptr(); + if (pc.type() != connection_type::bittorrent) return {}; bt_peer_connection* c = static_cast(pc.native_handle().get()); return std::make_shared(m_torrent, *c, *this); @@ -636,7 +635,7 @@ namespace libtorrent { { torrent* t = th.native_handle().get(); // don't add this extension if the torrent is private - if (t->valid_metadata() && t->torrent_file().priv()) return std::shared_ptr(); + if (t->valid_metadata() && t->torrent_file().priv()) return {}; return std::make_shared(*t); } } diff --git a/src/ut_pex.cpp b/src/ut_pex.cpp index f5b9b6434..7dedd7f8d 100644 --- a/src/ut_pex.cpp +++ b/src/ut_pex.cpp @@ -631,8 +631,7 @@ namespace libtorrent {namespace { std::shared_ptr ut_pex_plugin::new_connection(peer_connection_handle const& pc) { - if (pc.type() != connection_type::bittorrent) - return std::shared_ptr(); + if (pc.type() != connection_type::bittorrent) return {}; bt_peer_connection* c = static_cast(pc.native_handle().get()); auto p = std::make_shared(m_torrent, *c, *this); @@ -649,7 +648,7 @@ namespace libtorrent { if (t->torrent_file().priv() || (t->torrent_file().is_i2p() && !t->settings().get_bool(settings_pack::allow_i2p_mixed))) { - return std::shared_ptr(); + return {}; } return std::make_shared(*t); }