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
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)),