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>2011-11-25 17:36:28 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:28:55 +0300
commit34e4fdeeef46b33abf61a41fce064a9d8dc22e16 (patch)
tree40972a8ae002194a363140212d39c83ccc288a1e /indexer/types_mapping.cpp
parent278bc7b91df20cdf038bd21e03d1fd16e631f6fd (diff)
Fix type to index mapping. Load file once.
Diffstat (limited to 'indexer/types_mapping.cpp')
-rw-r--r--indexer/types_mapping.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/indexer/types_mapping.cpp b/indexer/types_mapping.cpp
index ed9a8382f7..539986b109 100644
--- a/indexer/types_mapping.cpp
+++ b/indexer/types_mapping.cpp
@@ -5,7 +5,7 @@
#include "../base/stl_add.hpp"
-void BaseTypeMapper::Load(istream & s)
+void IndexAndTypeMapping::Load(istream & s)
{
Classificator const & c = classif();
@@ -15,6 +15,7 @@ void BaseTypeMapper::Load(istream & s)
uint32_t ind = 0;
while (s.good())
{
+ v.clear();
s >> v;
if (!v.empty())
@@ -27,13 +28,10 @@ void BaseTypeMapper::Load(istream & s)
}
}
-void Index2Type::Add(uint32_t ind, uint32_t type)
+void IndexAndTypeMapping::Add(uint32_t ind, uint32_t type)
{
ASSERT_EQUAL ( ind, m_types.size(), () );
m_types.push_back(type);
-}
-void Type2Index::Add(uint32_t ind, uint32_t type)
-{
VERIFY ( m_map.insert(make_pair(type, ind)).second, (type, ind) );
}