From 84bb36a693394c6b966f593f19334972349f494e Mon Sep 17 00:00:00 2001 From: Andi-Bogdan Postelnicu Date: Thu, 17 Nov 2016 15:06:25 +0200 Subject: [PATCH] Bug 1318335 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11 in ipc/. r=billm MozReview-Commit-ID: CXLSBRhANNW --HG-- extra : rebase_source : 2c17b208e688504d34bd7e6aaccad64557afeafd --- ipc/glue/SharedMemoryBasic_mach.mm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ipc/glue/SharedMemoryBasic_mach.mm b/ipc/glue/SharedMemoryBasic_mach.mm index 88753ee2e817..72649892afbe 100644 --- a/ipc/glue/SharedMemoryBasic_mach.mm +++ b/ipc/glue/SharedMemoryBasic_mach.mm @@ -451,15 +451,15 @@ SharedMemoryBasic::Shutdown() { StaticMutexAutoLock smal(gMutex); - for (auto it = gThreads.begin(); it != gThreads.end(); ++it) { + for (auto& thread : gThreads) { MachSendMessage shutdownMsg(kShutdownMsg); - it->second.mPorts->mReceiver->SendMessageToSelf(shutdownMsg, kTimeout); + thread.second.mPorts->mReceiver->SendMessageToSelf(shutdownMsg, kTimeout); } gThreads.clear(); - for (auto it = gMemoryCommPorts.begin(); it != gMemoryCommPorts.end(); ++it) { - delete it->second.mSender; - delete it->second.mReceiver; + for (auto& memoryCommPort : gMemoryCommPorts) { + delete memoryCommPort.second.mSender; + delete memoryCommPort.second.mReceiver; } gMemoryCommPorts.clear(); } @@ -480,11 +480,11 @@ SharedMemoryBasic::CleanupForPid(pid_t pid) if (gParentPid == 0) { // We're the parent. Broadcast the cleanup message to everyone else. - for (auto it = gMemoryCommPorts.begin(); it != gMemoryCommPorts.end(); ++it) { + for (auto& memoryCommPort : gMemoryCommPorts) { MachSendMessage msg(kCleanupMsg); msg.SetData(&pid, sizeof(pid)); // We don't really care if this fails, we could be trying to send to an already shut down proc - it->second.mSender->SendMessage(msg, kTimeout); + memoryCommPort.second.mSender->SendMessage(msg, kTimeout); } }