forked from organicmaps/organicmaps
Minor code style changes.
This commit is contained in:
parent
31ffea5972
commit
9ffdda4cb6
7 changed files with 9 additions and 12 deletions
|
@ -178,6 +178,8 @@ bool to_uint64(char const * s, uint64_t & i);
|
|||
bool to_int64(char const * s, int64_t & i);
|
||||
bool to_double(char const * s, double & d);
|
||||
|
||||
inline bool is_number(string const & s) { int64_t dummy; return to_int64(s.c_str(), dummy); }
|
||||
|
||||
inline bool to_int(string const & s, int & i) { return to_int(s.c_str(), i); }
|
||||
inline bool to_uint64(string const & s, uint64_t & i) { return to_uint64(s.c_str(), i); }
|
||||
inline bool to_int64(string const & s, int64_t & i) { return to_int64(s.c_str(), i); }
|
||||
|
|
|
@ -255,8 +255,7 @@ bool FeatureBuilder1::PreSerialize()
|
|||
|
||||
void FeatureBuilder1::RemoveUselessNames()
|
||||
{
|
||||
int64_t dummy;
|
||||
if (!m_params.name.IsEmpty() && !GetCoastCell(dummy))
|
||||
if (!m_params.name.IsEmpty() && !IsCoastCell())
|
||||
{
|
||||
using namespace feature;
|
||||
|
||||
|
@ -274,8 +273,7 @@ void FeatureBuilder1::RemoveUselessNames()
|
|||
|
||||
void FeatureBuilder1::RemoveNameIfInvisible(int minS, int maxS)
|
||||
{
|
||||
int64_t dummy;
|
||||
if (!m_params.name.IsEmpty() && !GetCoastCell(dummy))
|
||||
if (!m_params.name.IsEmpty() && !IsCoastCell())
|
||||
{
|
||||
pair<int, int> const range = GetDrawableScaleRangeForRules(GetFeatureBase(), RULE_ANY_TEXT);
|
||||
if (range.first > maxS || range.second < minS)
|
||||
|
|
|
@ -150,6 +150,7 @@ public:
|
|||
int GetMinFeatureDrawScale() const;
|
||||
|
||||
void SetCoastCell(int64_t iCell, string const & strCell);
|
||||
inline bool IsCoastCell() const { return (m_coastCell != -1); }
|
||||
inline bool GetCoastCell(int64_t & cell) const
|
||||
{
|
||||
if (m_coastCell != -1)
|
||||
|
|
|
@ -434,8 +434,7 @@ namespace feature
|
|||
int const level = m_header.GetScale(i);
|
||||
if (fb.IsDrawableInRange(i > 0 ? m_header.GetScale(i-1) + 1 : 0, level))
|
||||
{
|
||||
int64_t dummy;
|
||||
bool const isCoast = fb.GetCoastCell(dummy);
|
||||
bool const isCoast = fb.IsCoastCell();
|
||||
m2::RectD const rect = fb.GetLimitRect();
|
||||
|
||||
// Simplify and serialize geometry.
|
||||
|
|
|
@ -103,9 +103,7 @@ namespace
|
|||
protected:
|
||||
bool HasID(FeatureBuilder1 const & fb) const
|
||||
{
|
||||
int64_t dummy;
|
||||
TEST(fb.GetCoastCell(dummy), ());
|
||||
|
||||
TEST(fb.IsCoastCell(), ());
|
||||
return (find(m_vID.begin(), m_vID.end(), fb.GetName()) != m_vID.end());
|
||||
}
|
||||
|
||||
|
|
|
@ -238,8 +238,7 @@ namespace ftype
|
|||
if (!m_isKey)
|
||||
{
|
||||
// Take numbers only for "capital" and "admin_level".
|
||||
int dummy;
|
||||
if (strings::to_int(v, dummy))
|
||||
if (strings::is_number(v))
|
||||
return (k == "admin_level" || k == "capital");
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -2121,7 +2121,7 @@ void Framework::BuildRoute(m2::PointD const & destination)
|
|||
}
|
||||
else
|
||||
{
|
||||
for(string const & name : route.GetAbsentCountries())
|
||||
for (string const & name : route.GetAbsentCountries())
|
||||
{
|
||||
storage::TIndex fileIndex = m_storage.FindIndexByFile(name);
|
||||
if (m_storage.GetLatestLocalFile(fileIndex))
|
||||
|
|
Loading…
Add table
Reference in a new issue