mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-21 11:01:36 +00:00
- Added FindEx to TArray.
This commit is contained in:
parent
8a7487ad14
commit
e7c37e5f51
1 changed files with 13 additions and 1 deletions
14
src/tarray.h
14
src/tarray.h
|
@ -272,6 +272,18 @@ public:
|
|||
return i;
|
||||
}
|
||||
|
||||
template<class Func>
|
||||
unsigned int FindEx(Func compare) const
|
||||
{
|
||||
unsigned int i;
|
||||
for (i = 0; i < Count; ++i)
|
||||
{
|
||||
if (compare(Array[i]))
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
unsigned int Push (const T &item)
|
||||
{
|
||||
Grow (1);
|
||||
|
@ -1049,7 +1061,7 @@ protected:
|
|||
if (!nold[i].IsNil())
|
||||
{
|
||||
Node *n = NewKey(nold[i].Pair.Key);
|
||||
::new(&n->Pair.Value) VT(nold[i].Pair.Value);
|
||||
::new(&n->Pair.Value) VT(std::move(nold[i].Pair.Value));
|
||||
nold[i].~Node();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue