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/rpc/core_rpc_server.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/rpc/core_rpc_server.cpp') diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 7d896e491..01d84f7ce 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -160,7 +160,7 @@ namespace cryptonote return false; } - BOOST_FOREACH(auto& b, bs) + for(auto& b: bs) { res.blocks.resize(res.blocks.size()+1); res.blocks.back().block = block_to_blob(b.first); @@ -173,7 +173,7 @@ namespace cryptonote return false; } size_t txidx = 0; - BOOST_FOREACH(auto& t, b.second) + for(auto& t: b.second) { res.blocks.back().txs.push_back(tx_to_blob(t)); res.output_indices.back().indices.push_back(COMMAND_RPC_GET_BLOCKS_FAST::tx_output_indices()); @@ -381,7 +381,7 @@ namespace cryptonote { CHECK_CORE_BUSY(); std::vector vh; - BOOST_FOREACH(const auto& tx_hex_str, req.txs_hashes) + for(const auto& tx_hex_str: req.txs_hashes) { blobdata b; if(!string_tools::parse_hexstr_to_binbuff(tx_hex_str, b)) @@ -433,7 +433,7 @@ namespace cryptonote std::list::const_iterator txhi = req.txs_hashes.begin(); std::vector::const_iterator vhi = vh.begin(); - BOOST_FOREACH(auto& tx, txs) + for(auto& tx: txs) { res.txs.push_back(COMMAND_RPC_GET_TRANSACTIONS::entry()); COMMAND_RPC_GET_TRANSACTIONS::entry &e = res.txs.back(); @@ -471,7 +471,7 @@ namespace cryptonote } } - BOOST_FOREACH(const auto& miss_tx, missed_txs) + for(const auto& miss_tx: missed_txs) { res.missed_tx.push_back(string_tools::pod_to_hex(miss_tx)); } @@ -485,7 +485,7 @@ namespace cryptonote { CHECK_CORE_BUSY(); std::vector key_images; - BOOST_FOREACH(const auto& ki_hex_str, req.key_images) + for(const auto& ki_hex_str: req.key_images) { blobdata b; if(!string_tools::parse_hexstr_to_binbuff(ki_hex_str, b)) @@ -908,7 +908,7 @@ namespace cryptonote uint64_t core_rpc_server::get_block_reward(const block& blk) { uint64_t reward = 0; - BOOST_FOREACH(const tx_out& out, blk.miner_tx.vout) + for(const tx_out& out: blk.miner_tx.vout) { reward += out.amount; } -- 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/cryptonote_core/blockchain.h | 1 - src/cryptonote_core/cryptonote_boost_serialization.h | 1 - src/cryptonote_core/cryptonote_core.cpp | 1 - src/cryptonote_core/cryptonote_format_utils.cpp | 1 - src/cryptonote_core/miner.cpp | 1 - src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp | 1 - src/p2p/connection_basic.cpp | 1 - src/p2p/net_node.h | 1 - src/p2p/net_peerlist.h | 1 - src/p2p/network_throttle-detail.cpp | 1 - src/p2p/network_throttle.hpp | 1 - src/rpc/core_rpc_server.cpp | 1 - 12 files changed, 12 deletions(-) (limited to 'src/rpc/core_rpc_server.cpp') diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index ca665e1d4..cd452faf4 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include diff --git a/src/cryptonote_core/cryptonote_boost_serialization.h b/src/cryptonote_core/cryptonote_boost_serialization.h index 7423b222a..409b9798c 100644 --- a/src/cryptonote_core/cryptonote_boost_serialization.h +++ b/src/cryptonote_core/cryptonote_boost_serialization.h @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index c5450c50d..b695ae2d4 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -31,7 +31,6 @@ #include "include_base_utils.h" using namespace epee; -#include #include #include "cryptonote_core.h" #include "common/command_line.h" diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index 03d81df25..70ba7ee18 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -32,7 +32,6 @@ using namespace epee; #include "cryptonote_format_utils.h" -#include #include "cryptonote_config.h" #include "miner.h" #include "crypto/crypto.h" diff --git a/src/cryptonote_core/miner.cpp b/src/cryptonote_core/miner.cpp index 204d6d069..88c631f80 100644 --- a/src/cryptonote_core/miner.cpp +++ b/src/cryptonote_core/miner.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include "misc_language.h" #include "include_base_utils.h" #include "cryptonote_basic_impl.h" diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp index 56b82ed15..09c202e79 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp +++ b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp @@ -52,7 +52,6 @@ #include "../../contrib/epee/include/net/net_utils_base.h" #include "../../contrib/epee/include/misc_log_ex.h" #include -#include #include #include #include diff --git a/src/p2p/connection_basic.cpp b/src/p2p/connection_basic.cpp index 80915e9a3..bdb239ca8 100644 --- a/src/p2p/connection_basic.cpp +++ b/src/p2p/connection_basic.cpp @@ -56,7 +56,6 @@ #include "../../contrib/epee/include/net/net_utils_base.h" #include "../../contrib/epee/include/misc_log_ex.h" #include -#include #include #include #include diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h index 40598fc0f..5ed96c00b 100644 --- a/src/p2p/net_node.h +++ b/src/p2p/net_node.h @@ -31,7 +31,6 @@ #pragma once #include #include -#include #include #include #include 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 diff --git a/src/p2p/network_throttle-detail.cpp b/src/p2p/network_throttle-detail.cpp index 9efaaf95a..d4fe356a9 100644 --- a/src/p2p/network_throttle-detail.cpp +++ b/src/p2p/network_throttle-detail.cpp @@ -54,7 +54,6 @@ #include "../../contrib/epee/include/net/net_utils_base.h" #include "../../contrib/epee/include/misc_log_ex.h" #include -#include #include #include #include diff --git a/src/p2p/network_throttle.hpp b/src/p2p/network_throttle.hpp index b954c5b3a..4f6cbe9cf 100644 --- a/src/p2p/network_throttle.hpp +++ b/src/p2p/network_throttle.hpp @@ -57,7 +57,6 @@ #include "../../contrib/epee/include/net/net_utils_base.h" #include "../../contrib/epee/include/misc_log_ex.h" #include -#include #include #include #include diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 01d84f7ce..1ce7c2b89 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -28,7 +28,6 @@ // // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers -#include #include "include_base_utils.h" using namespace epee; -- cgit v1.2.3