From 71ace2fbac58e535c8d1221557e2d10fe729a98a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 3 Jan 2020 15:54:51 +0100 Subject: [PATCH] util/AllocatedString: use std::exchange() --- src/util/AllocatedString.hxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util/AllocatedString.hxx b/src/util/AllocatedString.hxx index 7b1c6af76..ceb307b3a 100644 --- a/src/util/AllocatedString.hxx +++ b/src/util/AllocatedString.hxx @@ -135,9 +135,7 @@ public: } pointer_type Steal() { - pointer_type result = value; - value = nullptr; - return result; + return std::exchange(value, nullptr); } AllocatedString Clone() const {