diff --git a/Redcraft.Utility/Source/Private/Testing/ContainersTesting.cpp b/Redcraft.Utility/Source/Private/Testing/ContainersTesting.cpp index 785c44f..48c43be 100644 --- a/Redcraft.Utility/Source/Private/Testing/ContainersTesting.cpp +++ b/Redcraft.Utility/Source/Private/Testing/ContainersTesting.cpp @@ -29,7 +29,7 @@ void TestArrayTemplate() TArray ArrayB(4); TArray ArrayC(4, 4); TArray ArrayD(ArrayC); - TArray ArrayE(MoveTemp(ArrayB)); + TArray ArrayE(MoveTemp(ArrayC)); TArray ArrayF({ 0, 1, 2, 3 }); TArray ArrayG; @@ -40,9 +40,9 @@ void TestArrayTemplate() ArrayH = MoveTemp(ArrayE); ArrayI = { 0, 1, 2, 3 }; - always_check((ArrayC == TArray({ 4, 4, 4, 4 }))); always_check((ArrayD == TArray({ 4, 4, 4, 4 }))); always_check((ArrayG == TArray({ 4, 4, 4, 4 }))); + always_check((ArrayH == TArray({ 4, 4, 4, 4 }))); always_check((ArrayF == TArray({ 0, 1, 2, 3 }))); always_check((ArrayI == TArray({ 0, 1, 2, 3 }))); } diff --git a/Redcraft.Utility/Source/Public/Containers/Array.h b/Redcraft.Utility/Source/Public/Containers/Array.h index 389c2cc..d21a27d 100644 --- a/Redcraft.Utility/Source/Public/Containers/Array.h +++ b/Redcraft.Utility/Source/Public/Containers/Array.h @@ -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());