Commit 4ef9da11 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #28351: mainbuffer: use range-based for loops

parent c1660179
...@@ -351,8 +351,8 @@ size_t MainBuffer::discard(size_t toDiscard, const std::string &call_id) ...@@ -351,8 +351,8 @@ size_t MainBuffer::discard(size_t toDiscard, const std::string &call_id)
if (!callid_set or callid_set->empty()) if (!callid_set or callid_set->empty())
return 0; return 0;
for (CallIDSet::iterator iter = callid_set->begin(); iter != callid_set->end(); ++iter) for (auto &item : *callid_set)
discardByID(toDiscard, *iter, call_id); discardByID(toDiscard, item, call_id);
return toDiscard; return toDiscard;
} }
...@@ -374,9 +374,8 @@ void MainBuffer::flush(const std::string & call_id) ...@@ -374,9 +374,8 @@ void MainBuffer::flush(const std::string & call_id)
if (callid_set == NULL) if (callid_set == NULL)
return; return;
for (CallIDSet::iterator iter = callid_set->begin(); iter != callid_set->end(); ++iter) for (auto &item : *callid_set)
flushByID(*iter, call_id); flushByID(item, call_id);
} }
void MainBuffer::flushByID(const std::string & call_id, const std::string & reader_id) void MainBuffer::flushByID(const std::string & call_id, const std::string & reader_id)
...@@ -390,8 +389,8 @@ void MainBuffer::flushByID(const std::string & call_id, const std::string & read ...@@ -390,8 +389,8 @@ void MainBuffer::flushByID(const std::string & call_id, const std::string & read
void MainBuffer::flushAllBuffers() void MainBuffer::flushAllBuffers()
{ {
for (RingBufferMap::iterator iter = ringBufferMap_.begin(); iter != ringBufferMap_.end(); ++iter) for (auto &item : ringBufferMap_)
iter->second->flushAll(); item.second->flushAll();
} }
void MainBuffer::dumpInfo() void MainBuffer::dumpInfo()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment