Преглед изворни кода

Fix incorrect implementation of Vector::EraseSwap.

Eugene Kozlov пре 7 година
родитељ
комит
0304939fec
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      Source/Urho3D/Container/Vector.h

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

@@ -340,7 +340,8 @@ public:
         else
         else
         {
         {
             // Swap elements from the end of the array into the empty space
             // 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);
             Resize(newSize);
         }
         }
     }
     }