Skip to content
Snippets Groups Projects
Commit 2740f79a authored by Tristan Matthews's avatar Tristan Matthews
Browse files

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

parent 17bf6cea
No related branches found
No related tags found
No related merge requests found
...@@ -105,8 +105,8 @@ IAXVoIPLink::terminate() ...@@ -105,8 +105,8 @@ IAXVoIPLink::terminate()
sfl::ScopedLock m(iaxCallMapMutex_); sfl::ScopedLock m(iaxCallMapMutex_);
for (IAXCallMap::iterator iter = iaxCallMap_.begin(); iter != iaxCallMap_.end(); ++iter) { for (auto &iter : iaxCallMap_) {
IAXCall *call = static_cast<IAXCall*>(iter->second); IAXCall *call = static_cast<IAXCall*>(iter.second);
if (call) { if (call) {
sfl::ScopedLock lock(mutexIAX_); sfl::ScopedLock lock(mutexIAX_);
...@@ -182,8 +182,8 @@ IAXVoIPLink::getCallIDs() ...@@ -182,8 +182,8 @@ IAXVoIPLink::getCallIDs()
void void
IAXVoIPLink::sendAudioFromMic() IAXVoIPLink::sendAudioFromMic()
{ {
for (IAXCallMap::const_iterator iter = iaxCallMap_.begin(); iter != iaxCallMap_.end() ; ++iter) { for (const auto &iter : iaxCallMap_) {
IAXCall *currentCall = static_cast<IAXCall*>(iter->second); IAXCall *currentCall = static_cast<IAXCall*>(iter.second);
if (!currentCall or currentCall->getState() != Call::ACTIVE) if (!currentCall or currentCall->getState() != Call::ACTIVE)
continue; continue;
...@@ -460,9 +460,8 @@ IAXVoIPLink::clearIaxCallMap() ...@@ -460,9 +460,8 @@ IAXVoIPLink::clearIaxCallMap()
{ {
sfl::ScopedLock m(iaxCallMapMutex_); sfl::ScopedLock m(iaxCallMapMutex_);
for (IAXCallMap::const_iterator iter = iaxCallMap_.begin(); for (const auto &iter : iaxCallMap_)
iter != iaxCallMap_.end(); ++iter) delete iter.second;
delete iter->second;
iaxCallMap_.clear(); iaxCallMap_.clear();
...@@ -540,8 +539,8 @@ IAXVoIPLink::iaxFindCallBySession(iax_session* session) ...@@ -540,8 +539,8 @@ IAXVoIPLink::iaxFindCallBySession(iax_session* session)
{ {
sfl::ScopedLock m(iaxCallMapMutex_); sfl::ScopedLock m(iaxCallMapMutex_);
for (IAXCallMap::const_iterator iter = iaxCallMap_.begin(); iter != iaxCallMap_.end(); ++iter) { for (const auto &iter : iaxCallMap_) {
IAXCall* call = static_cast<IAXCall*>(iter->second); IAXCall* call = static_cast<IAXCall*>(iter.second);
if (call and call->session == session) if (call and call->session == session)
return call; return call;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment