[core] Use constexpr when possible

Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
x7z4w
2025-10-24 08:36:38 +00:00
parent 936e05283c
commit 42f059f8f7
90 changed files with 258 additions and 259 deletions

View File

@@ -22,7 +22,7 @@ namespace storage
{
namespace
{
size_t const kInvalidId = std::numeric_limits<size_t>::max();
size_t constexpr kInvalidId = std::numeric_limits<size_t>::max();
} // namespace
// CountryInfoGetterBase ---------------------------------------------------------------------------

View File

@@ -21,13 +21,13 @@ namespace
{
using namespace storage::diffs;
char const kMaxVersionKey[] = "max_version";
char const kMwmsKey[] = "mwms";
char const kNameKey[] = "name";
char const kSizeKey[] = "size";
char const kVersionKey[] = "version";
char constexpr kMaxVersionKey[] = "max_version";
char constexpr kMwmsKey[] = "mwms";
char constexpr kNameKey[] = "name";
char constexpr kSizeKey[] = "size";
char constexpr kVersionKey[] = "version";
auto const kTimeoutInSeconds = 5.0;
auto constexpr kTimeoutInSeconds = 5.0;
string SerializeCheckerData(LocalMapsInfo const & info)
{

View File

@@ -47,10 +47,10 @@ string const kDownloadQueueKey = "DownloadQueue";
// is most likely already fixed on OSM. Not limited to the latest one or two versions,
// because a user can forget to update maps after a new app version has been installed
// automatically in the background.
uint64_t const kMaxSecondsTillLastVersionUpdate = 3600 * 24 * 31 * 3;
uint64_t constexpr kMaxSecondsTillLastVersionUpdate = 3600 * 24 * 31 * 3;
// Editing maps older than approximately six months old is disabled, because the device
// may have been offline for a long time.
uint64_t const kMaxSecondsTillNoEdits = 3600 * 24 * 31 * 6;
uint64_t constexpr kMaxSecondsTillNoEdits = 3600 * 24 * 31 * 6;
void DeleteCountryIndexes(LocalCountryFile const & localFile)
{