fs/io/FileReader: use std::exchange()

This commit is contained in:
Max Kellermann 2018-08-21 18:25:14 +02:00
parent 5ca0b7a28f
commit 84df470008

View File

@ -49,9 +49,7 @@ public:
#ifdef _WIN32 #ifdef _WIN32
FileReader(FileReader &&other) noexcept FileReader(FileReader &&other) noexcept
:path(std::move(other.path)), :path(std::move(other.path)),
handle(other.handle) { handle(std::exchange(other.handle, INVALID_HANDLE_VALUE)) {}
other.handle = INVALID_HANDLE_VALUE;
}
#else #else
FileReader(FileReader &&other) noexcept FileReader(FileReader &&other) noexcept
:path(std::move(other.path)), :path(std::move(other.path)),