Removed a redundant check in PoolVector

The set method of PoolVector<T> performs an indexing check twice.
This commit is contained in:
hbina085 2019-07-06 20:43:34 -04:00
parent 44db85d6f6
commit ff348e48f9

View file

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