summaryrefslogtreecommitdiff
path: root/src/util/HugeAllocator.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-09-19 18:41:32 +0200
committerMax Kellermann <max@musicpd.org>2017-09-19 19:42:21 +0200
commit8662427d4877bea204a92fb342bdac91586b2b09 (patch)
tree990833f985ef728466b1150dada860adc65b22f0 /src/util/HugeAllocator.hxx
parent821480d329fad766cf7824cf1523ceed139aecf2 (diff)
util/HugeAllocator: use std::exchange()
Diffstat (limited to 'src/util/HugeAllocator.hxx')
-rw-r--r--src/util/HugeAllocator.hxx4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/util/HugeAllocator.hxx b/src/util/HugeAllocator.hxx
index 75f75761e..7f75a7ce1 100644
--- a/src/util/HugeAllocator.hxx
+++ b/src/util/HugeAllocator.hxx
@@ -125,9 +125,7 @@ public:
:data(HugeAllocate(_size)), size(_size) {}
HugeAllocation(HugeAllocation &&src) noexcept
- :data(src.data), size(src.size) {
- src.data = nullptr;
- }
+ :data(std::exchange(src.data, nullptr)), size(src.size) {}
~HugeAllocation() {
if (data != nullptr)