diff --git a/core/pool_vector.h b/core/pool_vector.h index aba66e39099..98a52c69381 100644 --- a/core/pool_vector.h +++ b/core/pool_vector.h @@ -488,9 +488,7 @@ T PoolVector::get(int p_index) const { template void PoolVector::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;