2
0
Эх сурвалжийг харах

Use unused from in local vector find function.

(cherry picked from commit 14d590805775ff9b328e4e632ac0d442f1ccaccc)
Ricard Rovira 4 жил өмнө
parent
commit
84474c0e6f
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      core/local_vector.h

+ 2 - 1
core/local_vector.h

@@ -177,7 +177,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);
 			}