From 623596f327f9e7ace9ce52fa05c10bbb19d69643 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 19 Jul 2017 16:20:00 +0200 Subject: [PATCH] avoid unnecessary temp. vector --- src/remoteClient/clientContextImpl.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/remoteClient/clientContextImpl.cpp b/src/remoteClient/clientContextImpl.cpp index 130d872..8495832 100644 --- a/src/remoteClient/clientContextImpl.cpp +++ b/src/remoteClient/clientContextImpl.cpp @@ -3912,23 +3912,15 @@ public: m_needSubscriptionUpdate = true; - int count = 0; - std::vector rrs(m_responseRequests.size()); for (IOIDResponseRequestMap::iterator iter = m_responseRequests.begin(); iter != m_responseRequests.end(); iter++) { - rrs[count++] = iter->second; + ResponseRequest::shared_pointer ptr(iter->second.lock()); + if(ptr) + EXCEPTION_GUARD(ptr->reportStatus(state)); } - ResponseRequest::shared_pointer ptr; - for (int i = 0; i< count; i++) - { - if((ptr = rrs[i].lock())) - { - EXCEPTION_GUARD(ptr->reportStatus(state)); - } - } } /**