summaryrefslogtreecommitdiff
path: root/core/vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/vector.h')
-rw-r--r--core/vector.h10
1 files changed, 5 insertions, 5 deletions
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 <class T_val>
- 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<T>::_copy_on_write() {
}
template<class T> template<class T_val>
-int Vector<T>::find(const T_val &p_val) const {
+int Vector<T>::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<size(); i++) {
+ for (int i=p_from; i<size(); i++) {
if (operator[](i) == p_val) {
ret = i;
@@ -253,7 +253,7 @@ int Vector<T>::find(const T_val &p_val) const {
};
return ret;
-};
+}
template<class T>
Error Vector<T>::resize(int p_size) {