Browse Source

Fix incorrect implementation of Vector::EraseSwap.

Eugene Kozlov 7 years ago
parent
commit
0304939fec
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Source/Urho3D/Container/Vector.h

+ 2 - 1
Source/Urho3D/Container/Vector.h

@@ -340,7 +340,8 @@ public:
         else
         {
             // Swap elements from the end of the array into the empty space
-            std::move(Buffer() + newSize, End(), Buffer() + pos);
+            T* buffer = Buffer();
+            std::move(buffer + newSize, buffer + size_, buffer + pos);
             Resize(newSize);
         }
     }