From 269d5704202d29d1f367abfb2df44fa19997fd18 Mon Sep 17 00:00:00 2001 From: George Marques Date: Fri, 10 Jun 2016 14:57:56 -0300 Subject: Add 'from' argument to Array.find() --- core/vector.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/vector.h') diff --git a/core/vector.h b/core/vector.h index 87248ccf68..cafb4a4aa3 100644 --- a/core/vector.h +++ b/core/vector.h @@ -120,7 +120,7 @@ public: template - int find(const T_val& p_val) const; + int find(const T_val& p_val, int p_from=0) const; void set(int p_index,T p_elem); T get(int p_index) const; @@ -238,13 +238,13 @@ void Vector::_copy_on_write() { } template template -int Vector::find(const T_val &p_val) const { +int Vector::find(const T_val &p_val, int p_from) const { int ret = -1; - if (size() == 0) + if (p_from < 0 || size() == 0) return ret; - for (int i=0; i::find(const T_val &p_val) const { }; return ret; -}; +} template Error Vector::resize(int p_size) { -- cgit v1.2.3