diff --git a/include/fmt/format.h b/include/fmt/format.h index 9bf35a31..16ac40c4 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -853,10 +853,8 @@ class basic_memory_buffer : public detail::buffer { if (alloc_ != other.alloc_ && data != other.store_) { size_t size = other.size(), capacity = other.capacity(); // Perform copy operation, allocators are different - this->reserve(size); - detail::copy(data, data + size, this->data()); this->resize(size); - other.clear(); + detail::copy(data, data + size, this->data()); return false; } return true;