mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 14:43:43 +00:00
[core] Replace SmallMap
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
committed by
Konstantin Pastbin
parent
969e1ef2da
commit
882dccb87d
@@ -75,19 +75,18 @@ RoutingOptionsClassifier::RoutingOptionsClassifier()
|
||||
{{"psurface", "paved_good"}, RoutingOptions::Road::Paved},
|
||||
{{"psurface", "paved_bad"}, RoutingOptions::Road::Paved}};
|
||||
|
||||
m_data.Reserve(std::size(types));
|
||||
m_data.reserve(std::size(types));
|
||||
for (auto const & data : types)
|
||||
m_data.Insert(c.GetTypeByPath(data.first), data.second);
|
||||
m_data.FinishBuilding();
|
||||
m_data.insert({c.GetTypeByPath(data.first), data.second});
|
||||
}
|
||||
|
||||
optional<RoutingOptions::Road> RoutingOptionsClassifier::Get(uint32_t type) const
|
||||
{
|
||||
ftype::TruncValue(type, 2); // in case of highway-motorway-bridge
|
||||
|
||||
auto const * res = m_data.Find(type);
|
||||
if (res)
|
||||
return *res;
|
||||
auto const it = m_data.find(type);
|
||||
if (it != m_data.cend())
|
||||
return it->second;
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user