summaryrefslogtreecommitdiff
path: root/core/templates/vector.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-10 13:39:55 +0200
committerGitHub <noreply@github.com>2022-05-10 13:39:55 +0200
commitcc66d5e173ef5e585321853178449b19be739561 (patch)
tree0a76cb87b9b52ea3688c92489e6e05f46f8807e1 /core/templates/vector.h
parentb9b78fdaee9a55bb7d1741752ab1a84a325addba (diff)
parent380a53f02f3f5fd4037e6b743a0ca8fadfe754ca (diff)
Merge pull request #60855 from timothyqiu/packed-array-find
Add search methods for packed arrays
Diffstat (limited to 'core/templates/vector.h')
-rw-r--r--core/templates/vector.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/templates/vector.h b/core/templates/vector.h
index d87e76139b..2ac7c7630a 100644
--- a/core/templates/vector.h
+++ b/core/templates/vector.h
@@ -92,6 +92,8 @@ public:
_FORCE_INLINE_ const T &operator[](int p_index) const { return _cowdata.get(p_index); }
Error insert(int p_pos, T p_val) { return _cowdata.insert(p_pos, p_val); }
int find(const T &p_val, int p_from = 0) const { return _cowdata.find(p_val, p_from); }
+ int rfind(const T &p_val, int p_from = -1) const { return _cowdata.rfind(p_val, p_from); }
+ int count(const T &p_val) const { return _cowdata.count(p_val); }
void append_array(Vector<T> p_other);