diff options
author | Miguel Herranz <miguel@ipglider.org> | 2017-01-22 21:47:39 +0100 |
---|---|---|
committer | Miguel Herranz <miguel@ipglider.org> | 2017-01-22 21:47:39 +0100 |
commit | 36dd3e238fcac89115d2d6788e95f1302417e0c2 (patch) | |
tree | 97d97efd18eac56fa193ed68f8c418a4841aa634 /src/cryptonote_core | |
parent | Replace BOOST_FOREACH with C++11 ranged for (diff) | |
download | monero-36dd3e238fcac89115d2d6788e95f1302417e0c2.tar.xz |
Replace BOOST_REVERSE_FOREACH with ranged for
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 789687ce0..b344c5597 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -31,6 +31,7 @@ #include <algorithm> #include <cstdio> #include <boost/filesystem.hpp> +#include <boost/range/adaptor/reversed.hpp> #include "include_base_utils.h" #include "cryptonote_basic_impl.h" @@ -933,7 +934,7 @@ difficulty_type Blockchain::get_next_difficulty_for_alternative_chain(const std: size_t count = 0; size_t max_i = timestamps.size()-1; // get difficulties and timestamps from most recent blocks in alt chain - BOOST_REVERSE_FOREACH(auto it, alt_chain) + for(auto it: boost::adaptors::reverse(alt_chain)) { timestamps[max_i - count] = it->second.bl.timestamp; cumulative_difficulties[max_i - count] = it->second.cumulative_difficulty; |