Codechange: Replaced SmallVector::Find() non-const with std::find()

This commit is contained in:
Henry Wilson
2018-09-23 17:36:45 +01:00
committed by PeterN
parent f3938fdb83
commit 81315939b9
7 changed files with 12 additions and 20 deletions

View File

@@ -21,7 +21,7 @@
/* virtual */ PoolBase::~PoolBase()
{
PoolVector *pools = PoolBase::GetPools();
pools->Erase(pools->Find(this));
pools->erase(std::find(pools->begin(), pools->end(), this));
if (pools->size() == 0) delete pools;
}

View File

@@ -116,20 +116,6 @@ public:
return pos;
}
/**
* Search for the first occurrence of an item.
* The '!=' operator of T is used for comparison.
* @param item Item to search for
* @return The position of the item, or End() when not present
*/
inline T *Find(const T &item)
{
T *pos = this->Begin();
const T *end = this->End();
while (pos != end && *pos != item) pos++;
return pos;
}
/**
* Search for the first occurrence of an item.
* The '!=' operator of T is used for comparison.