From 9325c2d58130fbd15b8bae4275d5ed6d0e66dd21 Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Thu, 30 Jan 2014 13:54:25 -0800 Subject: [PATCH] false positive on activeRequests --- lib/listplusplus.h | 2 +- plugins/websocket/websocketsource.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/listplusplus.h b/lib/listplusplus.h index 7e9e99e..96c1b72 100644 --- a/lib/listplusplus.h +++ b/lib/listplusplus.h @@ -57,7 +57,7 @@ private: template bool contains(T iteratable, V value) { - return (std::find(iteratable.begin(), iteratable.end(), value) != iteratable.end()); + return iteratable.size() > 0 && (std::find(iteratable.begin(), iteratable.end(), value) != iteratable.end()); } template diff --git a/plugins/websocket/websocketsource.cpp b/plugins/websocket/websocketsource.cpp index 615af3c..b576765 100644 --- a/plugins/websocket/websocketsource.cpp +++ b/plugins/websocket/websocketsource.cpp @@ -87,7 +87,7 @@ void WebSocketSource::checkSubscriptions() { VehicleProperty::Property prop = queuedRequests.front(); queuedRequests.pop_front(); - if (ListPlusPlus(&activeRequests).contains(prop)) + if (contains(activeRequests,prop)) { return; } -- 2.7.4