Fix a bug where polling messages would not work properly

This commit is contained in:
Paul Hollinsky
2018-10-22 16:19:20 -04:00
parent 319bd09cb4
commit 6456d4e261
+1 -1
View File
@@ -101,7 +101,7 @@ bool Device::getMessages(std::vector<std::shared_ptr<Message>>& container, size_
if(limit > (pollingContainer.size_approx() + 4)) if(limit > (pollingContainer.size_approx() + 4))
limit = (pollingContainer.size_approx() + 4); limit = (pollingContainer.size_approx() + 4);
if(container.capacity() < limit) if(container.size() < limit)
container.resize(limit); container.resize(limit);
size_t actuallyRead = pollingContainer.try_dequeue_bulk(container.data(), limit); size_t actuallyRead = pollingContainer.try_dequeue_bulk(container.data(), limit);