Skip to content

Commit cb16cf0

Browse files
PaulPaul
authored andcommitted
use auto for the iterators
1 parent 9601906 commit cb16cf0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/zmq/zmqnotificationinterface.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ CZMQNotificationInterface::~CZMQNotificationInterface()
2323
{
2424
Shutdown();
2525

26-
for (std::list<CZMQAbstractNotifier*>::iterator it=notifiers.begin(); it!=notifiers.end(); ++it)
26+
for (auto it=notifiers.begin(); it!=notifiers.end(); ++it)
2727
{
2828
delete *it;
2929
}
@@ -87,7 +87,7 @@ bool CZMQNotificationInterface::Initialize()
8787
return false;
8888
}
8989

90-
std::list<CZMQAbstractNotifier*>::iterator it=notifiers.begin();
90+
auto it=notifiers.begin();
9191
for (; it!=notifiers.end(); ++it)
9292
{
9393
if (it->Initialize(pcontext))
@@ -115,7 +115,7 @@ void CZMQNotificationInterface::Shutdown()
115115
LogPrint("zmq", "zmq: Shutdown notification interface\n");
116116
if (pcontext)
117117
{
118-
for (std::list<CZMQAbstractNotifier*>::iterator it=notifiers.begin(); it!=notifiers.end(); ++it)
118+
for (auto it=notifiers.begin(); it!=notifiers.end(); ++it)
119119
{
120120
LogPrint("zmq", " Shutdown notifier %s at %s\n", it->GetType(), it->GetAddress());
121121
it->Shutdown();
@@ -131,7 +131,7 @@ void CZMQNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, co
131131
if (fInitialDownload || pindexNew == pindexFork) // In IBD or blocks were disconnected without any new ones
132132
return;
133133

134-
for (std::list<CZMQAbstractNotifier*>::iterator it = notifiers.begin(); it!=notifiers.end(); )
134+
for (auto it = notifiers.begin(); it!=notifiers.end(); )
135135
{
136136
if (it->NotifyBlock(pindexNew))
137137
{
@@ -147,7 +147,7 @@ void CZMQNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, co
147147

148148
void CZMQNotificationInterface::SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, int posInBlock)
149149
{
150-
for (std::list<CZMQAbstractNotifier*>::iterator it = notifiers.begin(); it!=notifiers.end(); )
150+
for (auto it = notifiers.begin(); it!=notifiers.end(); )
151151
{
152152
if (it->NotifyTransaction(tx))
153153
{
@@ -163,7 +163,7 @@ void CZMQNotificationInterface::SyncTransaction(const CTransaction& tx, const CB
163163

164164
void CZMQNotificationInterface::NotifyTransactionLock(const CTransaction &tx)
165165
{
166-
for (std::list<CZMQAbstractNotifier*>::iterator it = notifiers.begin(); it!=notifiers.end(); )
166+
for (auto it = notifiers.begin(); it!=notifiers.end(); )
167167
{
168168
if (it->NotifyTransactionLock(tx))
169169
{
@@ -179,7 +179,7 @@ void CZMQNotificationInterface::NotifyTransactionLock(const CTransaction &tx)
179179

180180
void CZMQNotificationInterface::NotifyGovernanceVote(const CGovernanceVote &vote)
181181
{
182-
for (std::list<CZMQAbstractNotifier*>::iterator it = notifiers.begin(); it != notifiers.end(); )
182+
for (auto it = notifiers.begin(); it != notifiers.end(); )
183183
{
184184
if (it->NotifyGovernanceVote(vote))
185185
{
@@ -195,7 +195,7 @@ void CZMQNotificationInterface::NotifyGovernanceVote(const CGovernanceVote &vote
195195

196196
void CZMQNotificationInterface::NotifyGovernanceObject(const CGovernanceObject &object)
197197
{
198-
for (std::list<CZMQAbstractNotifier*>::iterator it = notifiers.begin(); it != notifiers.end(); )
198+
for (auto it = notifiers.begin(); it != notifiers.end(); )
199199
{
200200
if (it->NotifyGovernanceObject(object))
201201
{

0 commit comments

Comments
 (0)