Review fixes.

This commit is contained in:
Maxim Pimenov 2018-11-27 13:08:15 +03:00 committed by Tatiana Yan
parent dbd3473e5d
commit 28fcde75b3
3 changed files with 8 additions and 4 deletions

View file

@ -12,6 +12,7 @@
#include "base/timer.hpp"
#include <algorithm>
#include <set>
#include <utility>
using namespace std;

View file

@ -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);

View file

@ -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);