summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2019-03-26 23:57:54 +0000
committerPeterN <peter@fuzzle.org>2019-03-27 06:31:49 +0000
commited9005690a77a9bdfe334f79f6df0c421975161d (patch)
tree1087f194ed3630e1044f94cda030c7b5465a5d5c /src/core
parentb913c92aa77fb5f435d3f8795d0f6eae3e4ae132 (diff)
downloadopenttd-ed9005690a77a9bdfe334f79f6df0c421975161d.tar.xz
Fix #7421: Don't (directly) dereference std::vector::end() in SmallMap
Diffstat (limited to 'src/core')
-rw-r--r--src/core/smallmap_type.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp
index d7a9a3832..5eb94e23a 100644
--- a/src/core/smallmap_type.hpp
+++ b/src/core/smallmap_type.hpp
@@ -79,12 +79,12 @@ struct SmallMap : std::vector<SmallPair<T, U> > {
inline const Pair *End() const
{
- return &*std::vector<Pair>::end();
+ return std::vector<Pair>::data() + std::vector<Pair>::size();
}
inline Pair *End()
{
- return &*std::vector<Pair>::end();
+ return std::vector<Pair>::data() + std::vector<Pair>::size();
}