summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorstormcone <48624099+stormcone@users.noreply.github.com>2019-03-27 22:53:50 +0100
committerCharles Pigott <charlespigott@googlemail.com>2019-03-28 00:04:28 +0000
commitee260e4704edf4da23cd6cdf06b8b045badd3f7c (patch)
treed743ad81fe7489df61f59cfbea6e8b6e212a1430 /src/core
parent7fb77ff35a124f2533d4c467e289fbd2ec936fbd (diff)
downloadopenttd-ee260e4704edf4da23cd6cdf06b8b045badd3f7c.tar.xz
Fix #7165: SmallMap::Erase(key) does not work correctly
Diffstat (limited to 'src/core')
-rw-r--r--src/core/smallmap_type.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp
index 5eb94e23a..7cd6357ee 100644
--- a/src/core/smallmap_type.hpp
+++ b/src/core/smallmap_type.hpp
@@ -128,10 +128,10 @@ struct SmallMap : std::vector<SmallPair<T, U> > {
*/
inline bool Erase(const T &key)
{
- auto pair = std::find(this->begin(), this->end(), key);
- if (pair == this->end()) return false;
+ auto *pair = this->Find(key);
+ if (pair == this->End()) return false;
- std::vector<Pair>::erase(pair);
+ this->Erase(pair);
return true;
}