From 5db597c8b3711b3d6732229b9b0b6c3251db8ec8 Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Mon, 28 Aug 2017 09:18:06 -0400 Subject: [PATCH] more use of std::tuple_size<> and empty() --- include/libtorrent/socket_io.hpp | 4 ++-- src/path.cpp | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/libtorrent/socket_io.hpp b/include/libtorrent/socket_io.hpp index 0568eeb8a..690e4827d 100644 --- a/include/libtorrent/socket_io.hpp +++ b/include/libtorrent/socket_io.hpp @@ -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::value; else #endif - return address_v4::bytes_type().size(); + return std::tuple_size::value; } template diff --git a/src/path.cpp b/src/path.cpp index f37313302..010bede09 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -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 } } -