From 84df47000866cd609e9fb4096ca2ef37115ed7c3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 21 Aug 2018 18:25:14 +0200 Subject: [PATCH] fs/io/FileReader: use std::exchange() --- src/fs/io/FileReader.hxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/fs/io/FileReader.hxx b/src/fs/io/FileReader.hxx index a537e6c68..661682822 100644 --- a/src/fs/io/FileReader.hxx +++ b/src/fs/io/FileReader.hxx @@ -49,9 +49,7 @@ public: #ifdef _WIN32 FileReader(FileReader &&other) noexcept :path(std::move(other.path)), - handle(other.handle) { - other.handle = INVALID_HANDLE_VALUE; - } + handle(std::exchange(other.handle, INVALID_HANDLE_VALUE)) {} #else FileReader(FileReader &&other) noexcept :path(std::move(other.path)),