X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Falert.cpp;fp=src%2Falert.cpp;h=939881baa77d7a0859ad35ca1742d9c969a1cbbe;hp=25186673e0fe6feffb3e3c8888fd4c03be55b5bb;hb=5098ea454db9132aa0f576921ca9d1a69429d146;hpb=47d3ceb3da845e216fc9577cbf52f8b5600e5f93 diff --git a/src/alert.cpp b/src/alert.cpp index 2518667..939881b 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -2,7 +2,6 @@ // Alert system // -#include #include #include "alert.h" @@ -45,10 +44,10 @@ void CUnsignedAlert::SetNull() std::string CUnsignedAlert::ToString() const { std::string strSetCancel; - BOOST_FOREACH(int n, setCancel) + for (int n : setCancel) strSetCancel += strprintf("%d ", n); std::string strSetSubVer; - BOOST_FOREACH(std::string str, setSubVer) + for (const std::string& str : setSubVer) strSetSubVer += "\"" + str + "\" "; return strprintf( "CAlert(\n" @@ -108,7 +107,7 @@ bool CAlert::Cancels(const CAlert& alert) const return (alert.nID <= nCancel || setCancel.count(alert.nID)); } -bool CAlert::AppliesTo(int nVersion, std::string strSubVerIn) const +bool CAlert::AppliesTo(int nVersion, const std::string& strSubVerIn) const { // TODO: rework for client-version-embedded-in-strSubVer ? return (IsInEffect() && @@ -160,7 +159,7 @@ CAlert CAlert::getAlertByHash(const uint256 &hash) CAlert retval; { LOCK(cs_mapAlerts); - map::iterator mi = mapAlerts.find(hash); + auto mi = mapAlerts.find(hash); if(mi != mapAlerts.end()) retval = mi->second; } @@ -199,7 +198,7 @@ bool CAlert::ProcessAlert() { LOCK(cs_mapAlerts); // Cancel previous alerts - for (map::iterator mi = mapAlerts.begin(); mi != mapAlerts.end();) + for (auto mi = mapAlerts.begin(); mi != mapAlerts.end();) { const CAlert& alert = (*mi).second; if (Cancels(alert)) @@ -219,7 +218,7 @@ bool CAlert::ProcessAlert() } // Check if this alert has been cancelled - BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts) + for (auto& item : mapAlerts) { const CAlert& alert = item.second; if (alert.Cancels(*this))