Browse Source

Removed a redundant check in PoolVector

The set method of PoolVector<T> performs an indexing check twice.
hbina085 6 years ago
parent
commit
ff348e48f9
1 changed files with 1 additions and 3 deletions
  1. 1 3
      core/pool_vector.h

+ 1 - 3
core/pool_vector.h

@@ -488,9 +488,7 @@ T PoolVector<T>::get(int p_index) const {
 template <class T>
 void PoolVector<T>::set(int p_index, const T &p_val) {
 
-	if (p_index < 0 || p_index >= size()) {
-		ERR_FAIL_COND(p_index < 0 || p_index >= size());
-	}
+	ERR_FAIL_INDEX(p_index, size());
 
 	Write w = write();
 	w[p_index] = p_val;