Added contains method to PoolVector.

This commit is contained in:
Relintai 2022-04-18 12:58:39 +02:00
parent 361f949093
commit d252ecd131

View File

@ -441,6 +441,19 @@ public:
return rs; return rs;
} }
bool contains(const T &val) const {
Read r = read();
int s = size();
for (int i = 0; i < s; ++s) {
if (r[i] == val) {
return true;
}
}
return false;
}
bool is_locked() const { return alloc && alloc->lock.get() > 0; } bool is_locked() const { return alloc && alloc->lock.get() > 0; }
inline T operator[](int p_index) const; inline T operator[](int p_index) const;