Apply clang-tidy suggestions [modernize-loop-convert]

This commit is contained in:
Alexey Rybalchenko 2018-09-06 17:53:54 +02:00 committed by Dennis Klein
parent 1b53538d8c
commit 4951433330
2 changed files with 14 additions and 14 deletions

View File

@ -471,15 +471,15 @@ void FairMQDevice::PrintChannel(const string& name)
{ {
if (fChannels.find(name) != fChannels.end()) if (fChannels.find(name) != fChannels.end())
{ {
for (auto vi = fChannels[name].begin(); vi != fChannels[name].end(); ++vi) for (const auto& vi : fChannels[name])
{ {
LOG(info) << vi->fName << ": " LOG(info) << vi.fName << ": "
<< vi->fType << " | " << vi.fType << " | "
<< vi->fMethod << " | " << vi.fMethod << " | "
<< vi->fAddress << " | " << vi.fAddress << " | "
<< vi->fSndBufSize << " | " << vi.fSndBufSize << " | "
<< vi->fRcvBufSize << " | " << vi.fRcvBufSize << " | "
<< vi->fRateLogging; << vi.fRateLogging;
} }
} }
else else
@ -596,17 +596,17 @@ void FairMQDevice::HandleMultipleChannelInput()
for (const auto& mi : fMsgInputs) for (const auto& mi : fMsgInputs)
{ {
for (unsigned int i = 0; i < fChannels.at(mi.first).size(); ++i) for (auto& i : fChannels.at(mi.first))
{ {
fChannels.at(mi.first).at(i).fMultipart = false; i.fMultipart = false;
} }
} }
for (const auto& mi : fMultipartInputs) for (const auto& mi : fMultipartInputs)
{ {
for (unsigned int i = 0; i < fChannels.at(mi.first).size(); ++i) for (auto& i : fChannels.at(mi.first))
{ {
fChannels.at(mi.first).at(i).fMultipart = true; i.fMultipart = true;
} }
} }

View File

@ -443,9 +443,9 @@ void Monitor::PrintQueues()
{ {
cout << "found " << queues->size() << " queue(s):" << endl; cout << "found " << queues->size() << " queue(s):" << endl;
for (unsigned int i = 0; i < queues->size(); ++i) for (const auto& queue : *queues)
{ {
string name(queues->at(i).c_str()); string name(queue.c_str());
cout << '\t' << name << " : "; cout << '\t' << name << " : ";
atomic<int>* queueSize = segment.find<atomic<int>>(name.c_str()).first; atomic<int>* queueSize = segment.find<atomic<int>>(name.c_str()).first;
if (queueSize) if (queueSize)