fix(containers): fix TArray lost all elements after move assignment

This commit is contained in:
2024-11-02 23:07:05 +08:00
parent 728b91c317
commit 2bb0ddee5b
2 changed files with 5 additions and 3 deletions

View File

@ -189,7 +189,9 @@ public:
Memory::Destruct(Impl.Pointer, Num());
Impl->Deallocate(Impl.Pointer);
Impl.Pointer = InValue.Impl.Pointer;
Impl.ArrayNum = InValue.Num();
Impl.ArrayMax = InValue.Max();
Impl.Pointer = InValue.Impl.Pointer;
InValue.Impl.ArrayNum = 0;
InValue.Impl.ArrayMax = InValue.Impl->CalculateSlackReserve(InValue.Num());