mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-06 12:34:24 +00:00
[core] Use constexpr when possible
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
@@ -490,8 +490,8 @@ bool EditableMapObject::ValidatePhoneList(string const & phone)
|
||||
if (phone.empty())
|
||||
return true;
|
||||
|
||||
auto const kMaxNumberLen = 15;
|
||||
auto const kMinNumberLen = 5;
|
||||
auto constexpr kMaxNumberLen = 15;
|
||||
auto constexpr kMinNumberLen = 5;
|
||||
|
||||
if (phone.size() < kMinNumberLen)
|
||||
return false;
|
||||
|
||||
@@ -130,9 +130,9 @@ public:
|
||||
};
|
||||
|
||||
inline static std::string const kHeaderMagic = "mwmftosm";
|
||||
inline static Version const kLatestVersion = FeatureIdToGeoObjectIdSerDes::Version::V0;
|
||||
inline static size_t const kMagicAndVersionSize = 9;
|
||||
inline static size_t const kHeaderOffset = 16;
|
||||
inline static Version constexpr kLatestVersion = FeatureIdToGeoObjectIdSerDes::Version::V0;
|
||||
inline static size_t constexpr kMagicAndVersionSize = 9;
|
||||
inline static size_t constexpr kHeaderOffset = 16;
|
||||
|
||||
struct HeaderV0
|
||||
{
|
||||
|
||||
@@ -303,7 +303,7 @@ int GetMinDrawableScale(FeatureType & ft)
|
||||
|
||||
int GetMinDrawableScale(TypesHolder const & types, m2::RectD const & limitRect)
|
||||
{
|
||||
int const upBound = scales::GetUpperStyleScale();
|
||||
int constexpr upBound = scales::GetUpperStyleScale();
|
||||
|
||||
for (int level = 0; level <= upBound; ++level)
|
||||
if (IsDrawableForIndex(types, limitRect, level))
|
||||
@@ -315,7 +315,7 @@ int GetMinDrawableScale(TypesHolder const & types, m2::RectD const & limitRect)
|
||||
/*
|
||||
int GetMinDrawableScaleGeometryOnly(TypesHolder const & types, m2::RectD const & limitRect)
|
||||
{
|
||||
int const upBound = scales::GetUpperStyleScale();
|
||||
int constexpr upBound = scales::GetUpperStyleScale();
|
||||
|
||||
for (int level = 0; level <= upBound; ++level)
|
||||
{
|
||||
@@ -329,7 +329,7 @@ int GetMinDrawableScaleGeometryOnly(TypesHolder const & types, m2::RectD const &
|
||||
|
||||
int GetMinDrawableScaleClassifOnly(TypesHolder const & types)
|
||||
{
|
||||
int const upBound = scales::GetUpperStyleScale();
|
||||
int constexpr upBound = scales::GetUpperStyleScale();
|
||||
|
||||
for (int level = 0; level <= upBound; ++level)
|
||||
if (IsDrawableForIndexClassifOnly(types, level))
|
||||
@@ -406,7 +406,7 @@ bool IsDrawableForRules(TypesHolder const & types, int level, int rules)
|
||||
|
||||
pair<int, int> GetDrawableScaleRangeForRules(TypesHolder const & types, int rules)
|
||||
{
|
||||
int const upBound = scales::GetUpperStyleScale();
|
||||
int constexpr upBound = scales::GetUpperStyleScale();
|
||||
int lowL = -1;
|
||||
for (int level = 0; level <= upBound; ++level)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user