Loading sensors/2.0/multihal/HalProxy.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -486,15 +486,14 @@ void HalProxy::handlePendingWrites() { } } } } lock.lock(); lock.lock(); mSizePendingWriteEventsQueue -= numToWrite; if (pendingWriteEvents.size() > eventQueueSize) { if (pendingWriteEvents.size() > eventQueueSize) { // TODO(b/143302327): Check if this erase operation is too inefficient. It will copy // TODO(b/143302327): Check if this erase operation is too inefficient. It will copy // all the events ahead of it down to fill gap off array at front after the erase. // all the events ahead of it down to fill gap off array at front after the erase. pendingWriteEvents.erase(pendingWriteEvents.begin(), pendingWriteEvents.erase(pendingWriteEvents.begin(), pendingWriteEvents.begin() + eventQueueSize); pendingWriteEvents.begin() + eventQueueSize); mSizePendingWriteEventsQueue -= eventQueueSize; } else { } else { mPendingWriteEventsQueue.pop(); mPendingWriteEventsQueue.pop(); mSizePendingWriteEventsQueue -= pendingWriteEvents.size(); } } } } } } Loading Loading
sensors/2.0/multihal/HalProxy.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -486,15 +486,14 @@ void HalProxy::handlePendingWrites() { } } } } lock.lock(); lock.lock(); mSizePendingWriteEventsQueue -= numToWrite; if (pendingWriteEvents.size() > eventQueueSize) { if (pendingWriteEvents.size() > eventQueueSize) { // TODO(b/143302327): Check if this erase operation is too inefficient. It will copy // TODO(b/143302327): Check if this erase operation is too inefficient. It will copy // all the events ahead of it down to fill gap off array at front after the erase. // all the events ahead of it down to fill gap off array at front after the erase. pendingWriteEvents.erase(pendingWriteEvents.begin(), pendingWriteEvents.erase(pendingWriteEvents.begin(), pendingWriteEvents.begin() + eventQueueSize); pendingWriteEvents.begin() + eventQueueSize); mSizePendingWriteEventsQueue -= eventQueueSize; } else { } else { mPendingWriteEventsQueue.pop(); mPendingWriteEventsQueue.pop(); mSizePendingWriteEventsQueue -= pendingWriteEvents.size(); } } } } } } Loading