Commit 71ace2fb authored by Max Kellermann's avatar Max Kellermann

util/AllocatedString: use std::exchange()

parent fb450d2f
...@@ -135,9 +135,7 @@ public: ...@@ -135,9 +135,7 @@ public:
} }
pointer_type Steal() { pointer_type Steal() {
pointer_type result = value; return std::exchange(value, nullptr);
value = nullptr;
return result;
} }
AllocatedString Clone() const { AllocatedString Clone() const {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment