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-10-05 18:33:02 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:25:10 +0300
commit0922eff66cc195f076167693a04c27f6cf47332f (patch)
treef95a18feddfd1559d04519146d0b5fdca4f5d6e2
parent3ba0b129686c18af443c454cda149d824e1718da (diff)
Add const specifier tu function.
-rw-r--r--indexer/classificator.cpp2
-rw-r--r--indexer/classificator.hpp2
-rw-r--r--search/categories_holder.cpp4
3 files changed, 5 insertions, 3 deletions
diff --git a/indexer/classificator.cpp b/indexer/classificator.cpp
index c18a61b63d..c65500d667 100644
--- a/indexer/classificator.cpp
+++ b/indexer/classificator.cpp
@@ -479,7 +479,7 @@ void Classificator::SortClassificator()
GetMutableRoot()->Sort();
}
-uint32_t Classificator::GetTypeByPath(vector<string> const & path)
+uint32_t Classificator::GetTypeByPath(vector<string> const & path) const
{
ClassifObject const * p = GetRoot();
diff --git a/indexer/classificator.hpp b/indexer/classificator.hpp
index 2459e614d7..806b27c7e2 100644
--- a/indexer/classificator.hpp
+++ b/indexer/classificator.hpp
@@ -221,7 +221,7 @@ public:
/// Return type by path in classificator tree, example:
/// path = ["natural", "caostline"].
- uint32_t GetTypeByPath(vector<string> const & path);
+ uint32_t GetTypeByPath(vector<string> const & path) const;
uint32_t GetIndexForType(uint32_t t) const { return m_t2i.GetIndex(t); }
uint32_t GetTypeForIndex(uint32_t i) const { return m_i2t.GetType(i); }
diff --git a/search/categories_holder.cpp b/search/categories_holder.cpp
index a6bc854993..98f6f5bcd9 100644
--- a/search/categories_holder.cpp
+++ b/search/categories_holder.cpp
@@ -36,6 +36,8 @@ size_t CategoriesHolder::LoadFromStream(string const & buffer)
string line;
Category cat;
+ Classificator const & c = classif();
+
istringstream stream(buffer);
while (stream.good())
{
@@ -56,7 +58,7 @@ size_t CategoriesHolder::LoadFromStream(string const & buffer)
vector<string> v;
strings::Tokenize(*iter, "-", Splitter(v));
// get classificator type
- cat.m_types.push_back(classif().GetTypeByPath(v));
+ cat.m_types.push_back(c.GetTypeByPath(v));
++iter;
}
if (!cat.m_types.empty())