mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-22 06:03:45 +00:00
fix: don't return reference to object that goes out of scope
Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
@@ -152,7 +152,7 @@ std::vector<OSMTag> const & TypeToOSMTranslator::OsmTagsFromType(uint32_t type)
|
|||||||
if (it == m_storage.end())
|
if (it == m_storage.end())
|
||||||
{
|
{
|
||||||
ASSERT(false, ("OSM tags for type", type, "could not be found"));
|
ASSERT(false, ("OSM tags for type", type, "could not be found"));
|
||||||
return {};
|
return kEmptyResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
return it->second;
|
return it->second;
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ struct OSMTag
|
|||||||
class TypeToOSMTranslator
|
class TypeToOSMTranslator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
std::vector<OSMTag> static constexpr kEmptyResult = {};
|
||||||
|
|
||||||
TypeToOSMTranslator() : TypeToOSMTranslator(true) {}
|
TypeToOSMTranslator() : TypeToOSMTranslator(true) {}
|
||||||
explicit TypeToOSMTranslator(bool initialize);
|
explicit TypeToOSMTranslator(bool initialize);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user