From 7c8bbfadcacfba8d4410428fd6b66075bc7d0fea Mon Sep 17 00:00:00 2001 From: Ricard Rovira Date: Tue, 29 Jun 2021 13:37:02 +0200 Subject: [PATCH] Use unused from in local vector find function. (cherry picked from commit 14d590805775ff9b328e4e632ac0d442f1ccaccc) --- core/local_vector.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/local_vector.h b/core/local_vector.h index 752232c839a..3acdcd3554d 100644 --- a/core/local_vector.h +++ b/core/local_vector.h @@ -178,7 +178,8 @@ public: } int64_t find(const T &p_val, U p_from = 0) const { - for (U i = 0; i < count; i++) { + ERR_FAIL_UNSIGNED_INDEX_V(p_from, count, -1); + for (U i = p_from; i < count; i++) { if (data[i] == p_val) { return int64_t(i); }