util/AllocatedString: use std::exchange()

This commit is contained in:
Max Kellermann 2020-01-03 15:54:51 +01:00
parent fb450d2f41
commit 71ace2fbac

View File

@ -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 {