From 0922eff66cc195f076167693a04c27f6cf47332f Mon Sep 17 00:00:00 2001 From: vng Date: Wed, 5 Oct 2011 17:33:02 +0300 Subject: [PATCH] Add const specifier tu function. --- indexer/classificator.cpp | 2 +- indexer/classificator.hpp | 2 +- search/categories_holder.cpp | 4 +++- 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 const & path) +uint32_t Classificator::GetTypeByPath(vector 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 const & path); + uint32_t GetTypeByPath(vector 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 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())