diff options
author | vng <viktor.govako@gmail.com> | 2011-11-25 00:28:17 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:28:44 +0300 |
commit | 65530f86918698ec5cc6dbdd408e6295c28f7c1a (patch) | |
tree | 2b95e76f79c16a60b38e0b1a95ac72bebadfba8f /indexer/classificator.cpp | |
parent | c11367ac7accbbff694befc754132c3da8b76540 (diff) |
Avoid overhead in classificator reading (read to string -> istringstream).
Add reading of binary proto drawing rules.
Diffstat (limited to 'indexer/classificator.cpp')
-rw-r--r-- | indexer/classificator.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/indexer/classificator.cpp b/indexer/classificator.cpp index 47c1f03068..f010ad9572 100644 --- a/indexer/classificator.cpp +++ b/indexer/classificator.cpp @@ -427,14 +427,12 @@ bool ClassifObject::IsDrawableLike(FeatureGeoType ft) const return false; } -void Classificator::ReadClassificator(string const & buffer) +void Classificator::ReadClassificator(istream & s) { - istringstream iss(buffer); - m_root.Clear(); ClassifObject::LoadPolicy policy(&m_root); - tree::LoadTreeAsText(iss, policy); + tree::LoadTreeAsText(s, policy); m_root.Sort(); @@ -455,12 +453,10 @@ void Classificator::PrintClassificator(char const * fPath) #endif } -void Classificator::ReadVisibility(string const & buffer) +void Classificator::ReadVisibility(istream & s) { - istringstream iss(buffer); - ClassifObject::VisLoadPolicy policy(&m_root); - tree::LoadTreeAsText(iss, policy); + tree::LoadTreeAsText(s, policy); } void Classificator::PrintVisibility(char const * fPath) @@ -502,10 +498,10 @@ uint32_t Classificator::GetTypeByPath(vector<string> const & path) const return type; } -void Classificator::ReadTypesMapping(string const & buffer) +void Classificator::ReadTypesMapping(istream & s) { - m_i2t.Load(buffer); - m_t2i.Load(buffer); + m_i2t.Load(s); + m_t2i.Load(s); } void Classificator::Clear() |