forked from organicmaps/organicmaps
Review fixes.
This commit is contained in:
parent
dbd3473e5d
commit
28fcde75b3
3 changed files with 8 additions and 4 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "base/timer.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <set>
|
||||
#include <utility>
|
||||
|
||||
using namespace std;
|
||||
|
|
|
@ -174,11 +174,14 @@ void Hierarchy::IndexHouses()
|
|||
continue;
|
||||
|
||||
size_t const t = static_cast<size_t>(Type::Street);
|
||||
auto const * streetCandidates = GetEntries(be.m_address[t]);
|
||||
if (streetCandidates == nullptr)
|
||||
|
||||
// GetEntries() cannot be used here because one of the
|
||||
// "consts" in it conflicts with the emplace_back below.
|
||||
auto streetCandidatesIt = m_entries.find(be.m_address[t]);
|
||||
if (streetCandidatesIt == m_entries.end())
|
||||
continue;
|
||||
|
||||
for (auto & se : *streetCandidates)
|
||||
for (auto & se : streetCandidatesIt->second)
|
||||
{
|
||||
if (se.IsParentTo(be))
|
||||
se.m_buildingsOnStreet.emplace_back(&be);
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
|
||||
// List of houses that belong to the street that is desribed by this entry.
|
||||
// Only valid if |m_type| is Type::Street.
|
||||
mutable std::vector<Entry const *> m_buildingsOnStreet;
|
||||
std::vector<Entry const *> m_buildingsOnStreet;
|
||||
};
|
||||
|
||||
explicit Hierarchy(std::string const & pathToJsonHierarchy);
|
||||
|
|
Loading…
Add table
Reference in a new issue