Fixes for passing new unit tests with edge cases of scripting bindigns usage

This commit is contained in:
Wojtek Figat
2023-01-08 00:34:07 +01:00
parent 064994eb1a
commit cfcf29a62e
3 changed files with 128 additions and 32 deletions

View File

@@ -144,11 +144,11 @@ public:
/// <returns>The reference to this.</returns>
Array& operator=(std::initializer_list<T> initList) noexcept
{
Memory::DestructItems(_allocation.Get(), _count);
_count = _capacity = (int32)initList.size();
if (_capacity > 0)
Clear();
if (initList.size() > 0)
{
_allocation.Allocate(_capacity);
EnsureCapacity((int32)initList.size());
_count = (int32)initList.size();
Memory::ConstructItems(_allocation.Get(), initList.begin(), _count);
}
return *this;