From f9637e36bfa9f383b02194be66c005bc70898c0d Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Thu, 14 Jun 2012 18:42:46 -0700 Subject: [PATCH] Get rid of redunant SQL_FOREACH declarations. --- src/ConnectionPool.cpp | 4 ---- src/NetworkOPs.cpp | 4 ---- src/UniqueNodeList.cpp | 9 +++------ 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/ConnectionPool.cpp b/src/ConnectionPool.cpp index dc19481ff5..b576814527 100644 --- a/src/ConnectionPool.cpp +++ b/src/ConnectionPool.cpp @@ -11,10 +11,6 @@ #include #include -#define SQL_FOREACH(_db, _strQuery) \ - if ((_db)->executeSQL(_strQuery)) \ - for (bool _bMore = (_db)->startIterRows(); _bMore; _bMore = (_db)->getNextRow()) - void splitIpPort(const std::string& strIpPort, std::string& strIp, int& iPort) { std::vector vIpPort; diff --git a/src/NetworkOPs.cpp b/src/NetworkOPs.cpp index 312ec11622..6dd381171c 100644 --- a/src/NetworkOPs.cpp +++ b/src/NetworkOPs.cpp @@ -535,10 +535,6 @@ void NetworkOPs::setMode(OperatingMode om) mMode = om; } -#define SQL_FOREACH(_db, _strQuery) \ - if ((_db)->executeSQL(_strQuery)) \ - for (bool _bMore = (_db)->startIterRows(); _bMore; _bMore = (_db)->getNextRow()) - std::vector< std::pair > NetworkOPs::getAffectedAccounts(const NewcoinAddress& account, uint32 minLedger, uint32 maxLedger) { diff --git a/src/UniqueNodeList.cpp b/src/UniqueNodeList.cpp index 9e69ea985f..50a73df507 100644 --- a/src/UniqueNodeList.cpp +++ b/src/UniqueNodeList.cpp @@ -29,10 +29,6 @@ #define REFERRAL_VALIDATORS_MAX 50 #define REFERRAL_IPS_MAX 50 -#define SQL_FOREACH(_db, _strQuery) \ - if ((_db)->executeSQL(_strQuery)) \ - for (bool _bMore = (_db)->startIterRows(); _bMore; _bMore = (_db)->getNextRow()) - UniqueNodeList::UniqueNodeList(boost::asio::io_service& io_service) : mdtScoreTimer(io_service), mFetchActive(0), @@ -452,9 +448,10 @@ void UniqueNodeList::scoreCompute() std::string strIpPort = str(boost::format("%s %d") % ipEndpoint.first % ipEndpoint.second); score iPoints = ipScore.second; - vstrValues.push_back(str(boost::format("(%s,%d,'V')") + vstrValues.push_back(str(boost::format("(%s,%d,'%c')") % db->escape(strIpPort) - % iPoints)); + % iPoints + % vsValidator)); } // Set scores for each IP.