diff options
Diffstat (limited to 'core/vector.h')
-rw-r--r-- | core/vector.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/vector.h b/core/vector.h index b93d9a0dea..d103400622 100644 --- a/core/vector.h +++ b/core/vector.h @@ -340,12 +340,14 @@ template<class T> void Vector<T>::remove(int p_index) { ERR_FAIL_INDEX(p_index, size()); - for (int i=p_index; i<size()-1; i++) { + T*p=ptr(); + int len=size(); + for (int i=p_index; i<len-1; i++) { - set(i, get(i+1)); + p[i]=p[i+1]; }; - resize(size()-1); + resize(len-1); }; template<class T> |