false positive on activeRequests
authorKevron Rees <tripzero.kev@gmail.com>
Thu, 30 Jan 2014 21:54:25 +0000 (13:54 -0800)
committerKevron Rees <tripzero.kev@gmail.com>
Thu, 30 Jan 2014 21:54:25 +0000 (13:54 -0800)
lib/listplusplus.h
plugins/websocket/websocketsource.cpp

index 7e9e99e..96c1b72 100644 (file)
@@ -57,7 +57,7 @@ private:
 template <class T, class V>
 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 <class T, class V>
index 615af3c..b576765 100644 (file)
@@ -87,7 +87,7 @@ void WebSocketSource::checkSubscriptions()
        {
                VehicleProperty::Property prop = queuedRequests.front();
                queuedRequests.pop_front();
-               if (ListPlusPlus<VehicleProperty::Property>(&activeRequests).contains(prop))
+               if (contains(activeRequests,prop))
                {
                        return;
                }