mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 10:30:28 +00:00
(svn r24275) -Codechange: Make SmallVector::FindIndex() const.
This commit is contained in:
parent
de3b05388d
commit
e1617a3d10
@ -148,10 +148,10 @@ public:
|
|||||||
* @param item Item to search for
|
* @param item Item to search for
|
||||||
* @return The position of the item, or -1 when not present
|
* @return The position of the item, or -1 when not present
|
||||||
*/
|
*/
|
||||||
inline int FindIndex(const T &item)
|
inline int FindIndex(const T &item) const
|
||||||
{
|
{
|
||||||
int index = 0;
|
int index = 0;
|
||||||
T *pos = this->Begin();
|
const T *pos = this->Begin();
|
||||||
const T *end = this->End();
|
const T *end = this->End();
|
||||||
while (pos != end && *pos != item) {
|
while (pos != end && *pos != item) {
|
||||||
pos++;
|
pos++;
|
||||||
|
Loading…
Reference in New Issue
Block a user