summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhbina085 <hanif.ariffin.4326@gmail.com>2019-07-06 20:43:34 -0400
committerhbina085 <hanif.ariffin.4326@gmail.com>2019-07-07 19:04:56 -0400
commitff348e48f971df384a56ae47d4a4f4a5c78e45c1 (patch)
tree309f133518b3a1a31bd6177aca5f1307fb57c444
parent44db85d6f61e410c35a91db580166d9296fda77a (diff)
Removed a redundant check in PoolVector
The set method of PoolVector<T> performs an indexing check twice.
-rw-r--r--core/pool_vector.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/pool_vector.h b/core/pool_vector.h
index aba66e3909..98a52c6938 100644
--- a/core/pool_vector.h
+++ b/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;