assert vector is nonempty in SerialQueue::Enqueue

This commit is contained in:
Austin Eng 2017-06-19 14:19:27 -04:00 committed by Austin Eng
parent e480a0724c
commit 6aef6833b7
1 changed files with 2 additions and 0 deletions

View File

@ -110,12 +110,14 @@ namespace backend {
template<typename T>
void SerialQueue<T>::Enqueue(const std::vector<T>& values, Serial serial) {
ASSERT(values.size() > 0);
ASSERT(Empty() || storage.back().first <= serial);
storage.emplace_back(SerialPair(serial, {values}));
}
template<typename T>
void SerialQueue<T>::Enqueue(std::vector<T>&& values, Serial serial) {
ASSERT(values.size() > 0);
ASSERT(Empty() || storage.back().first <= serial);
storage.emplace_back(SerialPair(serial, {values}));
}