summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-06-29 14:36:19 +0200
committerGitHub <noreply@github.com>2021-06-29 14:36:19 +0200
commit7f9346b81b1349618231997221065267eabdf907 (patch)
tree6d648d6919a32174809d58dfb5ee6c97999e90ca
parent76dc811c76cb7fa8f91d51d09d5013f918354570 (diff)
parent14d590805775ff9b328e4e632ac0d442f1ccaccc (diff)
Merge pull request #49925 from RicardRC/FindFromNop
Make use of variable "from" in local_vector find() function.
-rw-r--r--core/templates/local_vector.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/templates/local_vector.h b/core/templates/local_vector.h
index 5f22e08eb8..5fa0f942aa 100644
--- a/core/templates/local_vector.h
+++ b/core/templates/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);
}