Merge branch 'mtszkarbowiak-fix/swapping'

This commit is contained in:
Wojtek Figat
2023-12-11 11:28:32 +01:00
3 changed files with 3 additions and 7 deletions

View File

@@ -734,9 +734,7 @@ public:
} }
else else
{ {
Array tmp = MoveTemp(other); ::Swap(other, *this);
other = *this;
*this = MoveTemp(tmp);
} }
} }

View File

@@ -616,9 +616,7 @@ public:
} }
else else
{ {
Dictionary tmp = MoveTemp(other); ::Swap(other, *this);
other = *this;
*this = MoveTemp(tmp);
} }
} }

View File

@@ -304,7 +304,7 @@ template<typename T>
inline void Swap(T& a, T& b) noexcept inline void Swap(T& a, T& b) noexcept
{ {
T tmp = MoveTemp(a); T tmp = MoveTemp(a);
a = b; a = MoveTemp(b);
b = MoveTemp(tmp); b = MoveTemp(tmp);
} }