Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2016-03-18 13:15:08 +0300
committerSergey Yershov <yershov@corp.mail.ru>2016-03-23 16:56:57 +0300
commitb7ec276112a151d2f221f5d69df76fdc86c4fd52 (patch)
tree8523151661852d8a686c0473cc6095e0546294d4
parentf2f6dd9cf9035090951b96be43d4c56fb5d3574e (diff)
Review fixes.
-rw-r--r--search/locality_finder.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/search/locality_finder.cpp b/search/locality_finder.cpp
index 6ddb30ff3e..11c479a63c 100644
--- a/search/locality_finder.cpp
+++ b/search/locality_finder.cpp
@@ -122,8 +122,8 @@ void LocalityFinder::UpdateCache(Cache & cache, m2::PointD const & pt) const
for (auto const & info : mwmsInfo)
{
Index::MwmHandle handle = m_pIndex->GetMwmHandleById(info);
- MwmValue const * pMwm = handle.GetValue<MwmValue>();
- if (pMwm && pMwm->GetHeader().GetType() == feature::DataHeader::world)
+ MwmValue const * value = handle.GetValue<MwmValue>();
+ if (handle.IsAlive() && value->GetHeader().GetType() == feature::DataHeader::world)
{
cache.m_rect = rect;
v2::MwmContext(move(handle)).ForEachFeature(rect, DoLoader(*this, cache));
@@ -134,19 +134,19 @@ void LocalityFinder::UpdateCache(Cache & cache, m2::PointD const & pt) const
void LocalityFinder::GetLocality(m2::PointD const & pt, string & name)
{
- Cache * pWorking = nullptr;
+ Cache * working = nullptr;
// Find suitable cache that includes needed point.
for (auto & cache : m_caches)
{
if (cache.m_rect.IsPointInside(pt))
{
- pWorking = &cache;
+ working = &cache;
break;
}
}
- if (pWorking == nullptr)
+ if (working == nullptr)
{
// Find most unused cache.
size_t minUsage = numeric_limits<size_t>::max();
@@ -154,17 +154,17 @@ void LocalityFinder::GetLocality(m2::PointD const & pt, string & name)
{
if (cache.m_usage < minUsage)
{
- pWorking = &cache;
+ working = &cache;
minUsage = cache.m_usage;
}
}
- pWorking->Clear();
+ ASSERT(working, ());
+ working->Clear();
}
- ASSERT(pWorking, ());
- UpdateCache(*pWorking, pt);
- pWorking->GetLocality(pt, name);
+ UpdateCache(*working, pt);
+ working->GetLocality(pt, name);
}
void LocalityFinder::ClearCache()