From ee260e4704edf4da23cd6cdf06b8b045badd3f7c Mon Sep 17 00:00:00 2001 From: stormcone <48624099+stormcone@users.noreply.github.com> Date: Wed, 27 Mar 2019 22:53:50 +0100 Subject: [PATCH] Fix #7165: SmallMap::Erase(key) does not work correctly --- src/core/smallmap_type.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp index 5eb94e23a2..7cd6357ee6 100644 --- a/src/core/smallmap_type.hpp +++ b/src/core/smallmap_type.hpp @@ -128,10 +128,10 @@ struct SmallMap : std::vector > { */ 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::erase(pair); + this->Erase(pair); return true; }