more use of std::tuple_size<> and empty()

This commit is contained in:
Alden Torres 2017-08-28 09:18:06 -04:00 committed by Arvid Norberg
parent 1075ae3b8d
commit 5db597c8b3
2 changed files with 3 additions and 4 deletions

View File

@ -63,10 +63,10 @@ namespace detail {
TORRENT_UNUSED(p);
#if TORRENT_USE_IPV6
if (p == Proto::v6())
return address_v6::bytes_type().size();
return std::tuple_size<address_v6::bytes_type>::value;
else
#endif
return address_v4::bytes_type().size();
return std::tuple_size<address_v4::bytes_type>::value;
}
template<class OutIt>

View File

@ -684,7 +684,7 @@ namespace libtorrent {
branch.assign(leaf.data(), leaf.size());
return;
}
if (leaf.size() == 0) return;
if (leaf.empty()) return;
#if defined(TORRENT_WINDOWS) || defined(TORRENT_OS2)
#define TORRENT_SEPARATOR_CHAR '\\'
@ -910,4 +910,3 @@ namespace libtorrent {
#endif
}
}