diff --git a/src/dawn/common/SerialMap.h b/src/dawn/common/SerialMap.h index cd26099c5a..6ada5d997d 100644 --- a/src/dawn/common/SerialMap.h +++ b/src/dawn/common/SerialMap.h @@ -16,6 +16,7 @@ #define SRC_DAWN_COMMON_SERIALMAP_H_ #include +#include #include #include "dawn/common/SerialStorage.h" @@ -54,7 +55,7 @@ void SerialMap::Enqueue(const Value& value, Serial serial) { template void SerialMap::Enqueue(Value&& value, Serial serial) { - this->mStorage[serial].emplace_back(value); + this->mStorage[serial].emplace_back(std::move(value)); } template @@ -68,8 +69,8 @@ void SerialMap::Enqueue(const std::vector& values, Serial template void SerialMap::Enqueue(std::vector&& values, Serial serial) { DAWN_ASSERT(values.size() > 0); - for (const Value& value : values) { - Enqueue(value, serial); + for (Value& value : values) { + Enqueue(std::move(value), serial); } } diff --git a/src/dawn/common/SerialQueue.h b/src/dawn/common/SerialQueue.h index d3d4f4feb5..378952e6c9 100644 --- a/src/dawn/common/SerialQueue.h +++ b/src/dawn/common/SerialQueue.h @@ -80,7 +80,7 @@ template void SerialQueue::Enqueue(std::vector&& values, Serial serial) { DAWN_ASSERT(values.size() > 0); DAWN_ASSERT(this->Empty() || this->mStorage.back().first <= serial); - this->mStorage.emplace_back(serial, values); + this->mStorage.emplace_back(serial, std::move(values)); } #endif // SRC_DAWN_COMMON_SERIALQUEUE_H_