From f3497a2a553e3557cc179894354dff0258daa1bb Mon Sep 17 00:00:00 2001 From: Mateusz Karbowiak Date: Fri, 8 Dec 2023 20:50:52 +0100 Subject: [PATCH] Fix swapping core collections --- Source/Engine/Core/Collections/Array.h | 4 +--- Source/Engine/Core/Collections/Dictionary.h | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Source/Engine/Core/Collections/Array.h b/Source/Engine/Core/Collections/Array.h index cf45ed060..a8390f051 100644 --- a/Source/Engine/Core/Collections/Array.h +++ b/Source/Engine/Core/Collections/Array.h @@ -734,9 +734,7 @@ public: } else { - Array tmp = MoveTemp(other); - other = *this; - *this = MoveTemp(tmp); + ::Swap(other, *this); } } diff --git a/Source/Engine/Core/Collections/Dictionary.h b/Source/Engine/Core/Collections/Dictionary.h index dd73be390..d2a840fff 100644 --- a/Source/Engine/Core/Collections/Dictionary.h +++ b/Source/Engine/Core/Collections/Dictionary.h @@ -616,9 +616,7 @@ public: } else { - Dictionary tmp = MoveTemp(other); - other = *this; - *this = MoveTemp(tmp); + ::Swap(other, *this); } }