Commit 561ccf60 authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

util/AllocatedArray: remove bogus assertions

`new T[0]` must not be nullptr.
parent aee861c0
...@@ -58,9 +58,7 @@ public: ...@@ -58,9 +58,7 @@ public:
constexpr AllocatedArray() = default; constexpr AllocatedArray() = default;
explicit AllocatedArray(size_type _size) noexcept explicit AllocatedArray(size_type _size) noexcept
:buffer{new T[_size], _size} { :buffer{new T[_size], _size} {}
assert(size() == 0 || buffer.data != nullptr);
}
explicit AllocatedArray(const AllocatedArray &other) noexcept { explicit AllocatedArray(const AllocatedArray &other) noexcept {
assert(other.size() == 0 || other.buffer.data != nullptr); assert(other.size() == 0 || other.buffer.data != nullptr);
...@@ -190,8 +188,6 @@ public: ...@@ -190,8 +188,6 @@ public:
delete[] buffer.data; delete[] buffer.data;
buffer.size = _size; buffer.size = _size;
buffer.data = new T[buffer.size]; buffer.data = new T[buffer.size];
assert(size() == 0 || buffer.data != nullptr);
} }
/** /**
...@@ -213,7 +209,6 @@ public: ...@@ -213,7 +209,6 @@ public:
return; return;
T *new_data = new T[_size]; T *new_data = new T[_size];
assert(_size == 0 || new_data != nullptr);
std::move(buffer.data, buffer.data + preserve, new_data); std::move(buffer.data, buffer.data + preserve, new_data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment