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>2012-06-23 05:06:23 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:40:12 +0300
commitff55299029bf97579f60a1c3c18d044b97c88796 (patch)
treea1d424e573226a434be013a5eec96500304c1a1a /storage
parent733b39ccb51c1c85b7a2e5ccde0e99efdebd3a13 (diff)
Minor performance fixes.
Diffstat (limited to 'storage')
-rw-r--r--storage/country.cpp13
-rw-r--r--storage/country_decl.cpp3
-rw-r--r--storage/country_decl.hpp2
-rw-r--r--storage/country_info.cpp2
4 files changed, 13 insertions, 7 deletions
diff --git a/storage/country.cpp b/storage/country.cpp
index 02618a3b00..054b66bcef 100644
--- a/storage/country.cpp
+++ b/storage/country.cpp
@@ -29,14 +29,21 @@ uint32_t CountryFile::GetFileSize() const
return 0;
}
-struct CountryBoundsCalculator
+class CountryBoundsCalculator
{
m2::RectD & m_bounds;
- CountryBoundsCalculator(m2::RectD & bounds) : m_bounds(bounds) {}
+ Platform & m_platform;
+
+public:
+ CountryBoundsCalculator(m2::RectD & bounds)
+ : m_bounds(bounds), m_platform(GetPlatform())
+ {
+ }
+
void operator()(CountryFile const & file)
{
feature::DataHeader h;
- LoadMapHeader(GetPlatform().GetReader(file.GetFileWithExt()), h);
+ LoadMapHeader(m_platform.GetReader(file.GetFileWithExt()), h);
m_bounds.Add(h.GetBounds());
}
};
diff --git a/storage/country_decl.cpp b/storage/country_decl.cpp
index 099191775c..534acd784c 100644
--- a/storage/country_decl.cpp
+++ b/storage/country_decl.cpp
@@ -1,7 +1,7 @@
#include "country_decl.hpp"
-string storage::CountryInfo::FileName2FullName(string fName)
+void storage::CountryInfo::FileName2FullName(string & fName)
{
size_t const i = fName.find('_');
if (i != string::npos)
@@ -10,7 +10,6 @@ string storage::CountryInfo::FileName2FullName(string fName)
fName[i] = ',';
fName.insert(i+1, " ");
}
- return fName;
}
void storage::CountryInfo::FullName2GroupAndMap(string const & fName, string & group, string & map)
diff --git a/storage/country_decl.hpp b/storage/country_decl.hpp
index e0d154bb87..18316f6650 100644
--- a/storage/country_decl.hpp
+++ b/storage/country_decl.hpp
@@ -30,7 +30,7 @@ namespace storage
bool IsNotEmpty() const { return !m_flag.empty(); }
- static string FileName2FullName(string fName);
+ static void FileName2FullName(string & fName);
static void FullName2GroupAndMap(string const & fName, string & group, string & map);
};
}
diff --git a/storage/country_info.cpp b/storage/country_info.cpp
index a9e59c2fb1..a475debf17 100644
--- a/storage/country_info.cpp
+++ b/storage/country_info.cpp
@@ -108,7 +108,7 @@ namespace storage
if (info.m_name.empty())
info.m_name = id;
- info.m_name = CountryInfo::FileName2FullName(info.m_name);
+ CountryInfo::FileName2FullName(info.m_name);
}
void CountryInfoGetter::CalcUSALimitRect(m2::RectD rects[3]) const