From 629e3101ab54edfcadc42c6f3d7ea9c4fa3f9a93 Mon Sep 17 00:00:00 2001 From: Miguel Herranz Date: Sun, 22 Jan 2017 21:38:10 +0100 Subject: Replace BOOST_FOREACH with C++11 ranged for --- src/p2p/net_peerlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/p2p/net_peerlist.h') diff --git a/src/p2p/net_peerlist.h b/src/p2p/net_peerlist.h index 4797eb82b..e9c31605d 100644 --- a/src/p2p/net_peerlist.h +++ b/src/p2p/net_peerlist.h @@ -230,7 +230,7 @@ namespace nodetool bool peerlist_manager::merge_peerlist(const std::list& outer_bs) { CRITICAL_REGION_LOCAL(m_peerlist_lock); - BOOST_FOREACH(const peerlist_entry& be, outer_bs) + for(const peerlist_entry& be: outer_bs) { append_with_peer_gray(be); } -- cgit v1.2.3 From 36dd3e238fcac89115d2d6788e95f1302417e0c2 Mon Sep 17 00:00:00 2001 From: Miguel Herranz Date: Sun, 22 Jan 2017 21:47:39 +0100 Subject: Replace BOOST_REVERSE_FOREACH with ranged for --- src/p2p/net_peerlist.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/p2p/net_peerlist.h') diff --git a/src/p2p/net_peerlist.h b/src/p2p/net_peerlist.h index e9c31605d..4745bad91 100644 --- a/src/p2p/net_peerlist.h +++ b/src/p2p/net_peerlist.h @@ -45,6 +45,7 @@ #include #include #include +#include #include "syncobj.h" @@ -283,7 +284,7 @@ namespace nodetool CRITICAL_REGION_LOCAL(m_peerlist_lock); peers_indexed::index::type& by_time_index=m_peers_white.get(); uint32_t cnt = 0; - BOOST_REVERSE_FOREACH(const peers_indexed::value_type& vl, by_time_index) + for(const peers_indexed::value_type& vl: boost::adaptors::reverse(by_time_index)) { if(!vl.last_seen) continue; @@ -301,13 +302,13 @@ namespace nodetool { CRITICAL_REGION_LOCAL(m_peerlist_lock); peers_indexed::index::type& by_time_index_gr=m_peers_gray.get(); - BOOST_REVERSE_FOREACH(const peers_indexed::value_type& vl, by_time_index_gr) + for(const peers_indexed::value_type& vl: boost::adaptors::reverse(by_time_index_gr)) { pl_gray.push_back(vl); } peers_indexed::index::type& by_time_index_wt=m_peers_white.get(); - BOOST_REVERSE_FOREACH(const peers_indexed::value_type& vl, by_time_index_wt) + for(const peers_indexed::value_type& vl: boost::adaptors::reverse(by_time_index_wt)) { pl_white.push_back(vl); } -- cgit v1.2.3 From 0644eed7728d3b5146ca7b53f7c50a56b02b327b Mon Sep 17 00:00:00 2001 From: Miguel Herranz Date: Sun, 22 Jan 2017 23:31:34 +0100 Subject: Remove boost/foreach.cpp includes --- src/p2p/net_peerlist.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/p2p/net_peerlist.h') diff --git a/src/p2p/net_peerlist.h b/src/p2p/net_peerlist.h index 4745bad91..d477f881b 100644 --- a/src/p2p/net_peerlist.h +++ b/src/p2p/net_peerlist.h @@ -33,7 +33,6 @@ #include #include #include -#include //#include //#include #include -- cgit v1.2.3