Skip to content

Commit

Permalink
memory/GrowingBuffer: use std::exchange()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Jan 17, 2025
1 parent 7840bc0 commit 026cda8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/memory/GrowingBuffer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ public:
GrowingBuffer() = default;

GrowingBuffer(GrowingBuffer &&src) noexcept
:head(std::move(src.head)), tail(src.tail) {
src.tail = nullptr;
}
:head(std::move(src.head)), tail(std::exchange(src.tail, nullptr)) {}

GrowingBuffer &operator=(GrowingBuffer &&src) noexcept {
using std::swap;
Expand Down

0 comments on commit 026cda8

Please sign in to comment.