mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-03-14 00:48:52 +01:00
Move the definition of contains() from PoolVector class to the bottom of the file. I'm hoping to avoid a new potential divide by 0
warning on windows.
This commit is contained in:
parent
bb303112fe
commit
93370e9c1d
@ -441,18 +441,7 @@ public:
|
||||
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 contains(const T &p_val) const;
|
||||
|
||||
bool is_locked() const { return alloc && alloc->lock.get() > 0; }
|
||||
|
||||
@ -500,6 +489,20 @@ void PoolVector<T>::push_back(const T &p_val) {
|
||||
set(size() - 1, p_val);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool PoolVector<T>::contains(const T &p_val) const {
|
||||
Read r = read();
|
||||
int s = size();
|
||||
|
||||
for (int i = 0; i < s; ++s) {
|
||||
if (r[i] == p_val) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T PoolVector<T>::operator[](int p_index) const {
|
||||
CRASH_BAD_INDEX(p_index, size());
|
||||
|
Loading…
Reference in New Issue
Block a user