mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Removed SmallVector::Insert()
parent
a0f36a50e6
commit
e0c58bf5ee
|
@ -66,20 +66,6 @@ public:
|
||||||
|
|
||||||
~SmallVector() = default;
|
~SmallVector() = default;
|
||||||
|
|
||||||
/**
|
|
||||||
* Insert a new item at a specific position into the vector, moving all following items.
|
|
||||||
* @param item Position at which the new item should be inserted
|
|
||||||
* @return pointer to the new item
|
|
||||||
*/
|
|
||||||
inline T *Insert(T *item)
|
|
||||||
{
|
|
||||||
assert(item >= this->Begin() && item <= this->End());
|
|
||||||
|
|
||||||
size_t start = item - this->Begin();
|
|
||||||
std::vector<T>::insert(std::vector<T>::begin() + start);
|
|
||||||
return this->Begin() + start;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search for the first occurrence of an item.
|
* Search for the first occurrence of an item.
|
||||||
* The '!=' operator of T is used for comparison.
|
* The '!=' operator of T is used for comparison.
|
||||||
|
|
Loading…
Reference in New Issue