util/HugeAllocator: use std::exchange()

This commit is contained in:
Max Kellermann 2017-09-19 18:41:32 +02:00
parent 821480d329
commit 8662427d48

View File

@ -125,9 +125,7 @@ public:
:data(HugeAllocate(_size)), size(_size) {} :data(HugeAllocate(_size)), size(_size) {}
HugeAllocation(HugeAllocation &&src) noexcept HugeAllocation(HugeAllocation &&src) noexcept
:data(src.data), size(src.size) { :data(std::exchange(src.data, nullptr)), size(src.size) {}
src.data = nullptr;
}
~HugeAllocation() { ~HugeAllocation() {
if (data != nullptr) if (data != nullptr)