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:
authorYuri Gorshenin <y@maps.me>2015-04-24 19:15:50 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:46:26 +0300
commitb3c84850c0d8e5e70fafcd30a0c023dd5b1fd886 (patch)
treec54f46afc250622847fb9f8ee2931f333647635d /indexer/mwm_set.cpp
parentbe94193c94643040a3299ca0a67bba3da5423f3f (diff)
[index] Removed MwmSet::m_name.
Diffstat (limited to 'indexer/mwm_set.cpp')
-rw-r--r--indexer/mwm_set.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/indexer/mwm_set.cpp b/indexer/mwm_set.cpp
index a00251f148..c41a961b12 100644
--- a/indexer/mwm_set.cpp
+++ b/indexer/mwm_set.cpp
@@ -97,8 +97,8 @@ void MwmSet::Cleanup()
{
if (m_info[i].IsUpToDate())
{
- ASSERT_EQUAL(m_info[i].m_lockCount, 0, (i, m_name[i]));
- ASSERT_NOT_EQUAL(m_name[i], string(), (i));
+ ASSERT_EQUAL(m_info[i].m_lockCount, 0, (i, m_info[i].m_fileName));
+ ASSERT(!m_info[i].m_fileName.empty(), (i));
}
}
#endif
@@ -120,19 +120,18 @@ MwmSet::MwmId MwmSet::GetFreeId()
}
m_info.push_back(MwmInfo());
- m_name.push_back(string());
return size;
}
MwmSet::MwmId MwmSet::GetIdByName(string const & name)
{
- ASSERT ( !name.empty(), () );
+ ASSERT(!name.empty(), ());
for (MwmId i = 0; i < m_info.size(); ++i)
{
UpdateMwmInfo(i);
- if (m_name[i] == name)
+ if (m_info[i].m_fileName == name)
{
ASSERT_NOT_EQUAL(m_info[i].GetStatus(), MwmInfo::STATUS_DEREGISTERED, ());
return i;
@@ -167,9 +166,9 @@ pair<MwmSet::MwmLock, bool> MwmSet::RegisterImpl(string const & fileName)
return make_pair(MwmLock(), false);
info.SetStatus(MwmInfo::STATUS_UP_TO_DATE);
+ info.m_fileName = fileName;
MwmId const id = GetFreeId();
- m_name[id] = fileName;
m_info[id] = info;
return make_pair(GetLock(id), true);
@@ -179,15 +178,12 @@ bool MwmSet::DeregisterImpl(MwmId id)
{
if (m_info[id].m_lockCount == 0)
{
- m_name[id].clear();
+ m_info[id].m_fileName.clear();
m_info[id].SetStatus(MwmInfo::STATUS_DEREGISTERED);
return true;
}
- else
- {
- m_info[id].SetStatus(MwmInfo::STATUS_MARKED_TO_DEREGISTER);
- return false;
- }
+ m_info[id].SetStatus(MwmInfo::STATUS_MARKED_TO_DEREGISTER);
+ return false;
}
void MwmSet::Deregister(string const & fileName)
@@ -277,7 +273,7 @@ MwmSet::MwmValueBase * MwmSet::LockValueImpl(MwmId id)
return result;
}
}
- return CreateValue(m_name[id]);
+ return CreateValue(m_info[id].m_fileName);
}
void MwmSet::UnlockValue(MwmId id, MwmValueBase * p)