diff options
author | Henry Wilson <m3henry@googlemail.com> | 2018-09-23 17:36:45 +0100 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-26 20:15:57 +0000 |
commit | 81315939b909a95277ffbab51709714779089656 (patch) | |
tree | 9ee8bf1dc8e63cc0a44795ae6d23194d03bf6628 /src/core | |
parent | f3938fdb838685e76bba78974bb6e90e9afc6e22 (diff) | |
download | openttd-81315939b909a95277ffbab51709714779089656.tar.xz |
Codechange: Replaced SmallVector::Find() non-const with std::find()
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/pool_func.cpp | 2 | ||||
-rw-r--r-- | src/core/smallvec_type.hpp | 14 |
2 files changed, 1 insertions, 15 deletions
diff --git a/src/core/pool_func.cpp b/src/core/pool_func.cpp index 914cbcfd9..97f9ad1c7 100644 --- a/src/core/pool_func.cpp +++ b/src/core/pool_func.cpp @@ -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; } diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 7e0abec76..289cc9e1d 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -120,20 +120,6 @@ public: * 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. - * @param item Item to search for * @return The position of the item, or -1 when not present */ inline int FindIndex(const T &item) const |