mirror of https://github.com/OpenTTD/OpenTTD
Fix #7165: SmallMap::Erase(key) does not work correctly
parent
7fb77ff35a
commit
ee260e4704
|
@ -128,10 +128,10 @@ struct SmallMap : std::vector<SmallPair<T, U> > {
|
||||||
*/
|
*/
|
||||||
inline bool Erase(const T &key)
|
inline bool Erase(const T &key)
|
||||||
{
|
{
|
||||||
auto pair = std::find(this->begin(), this->end(), key);
|
auto *pair = this->Find(key);
|
||||||
if (pair == this->end()) return false;
|
if (pair == this->End()) return false;
|
||||||
|
|
||||||
std::vector<Pair>::erase(pair);
|
this->Erase(pair);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue