mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-04-09 21:32:37 +02: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;
|
return rs;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool contains(const T &val) const {
|
bool contains(const T &p_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; }
|
||||||
|
|
||||||
@ -500,6 +489,20 @@ void PoolVector<T>::push_back(const T &p_val) {
|
|||||||
set(size() - 1, 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>
|
template <class T>
|
||||||
T PoolVector<T>::operator[](int p_index) const {
|
T PoolVector<T>::operator[](int p_index) const {
|
||||||
CRASH_BAD_INDEX(p_index, size());
|
CRASH_BAD_INDEX(p_index, size());
|
||||||
|
Loading…
Reference in New Issue
Block a user