summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_regular/src/cache_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/policy_regular/src/cache_manager.cc')
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index 5a75c47725..d031b5f027 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -79,7 +79,7 @@ SDL_CREATE_LOG_VARIABLE("Policy")
}
struct LanguageFinder {
- LanguageFinder(const std::string& language) : language_(language) {}
+ explicit LanguageFinder(const std::string& language) : language_(language) {}
bool operator()(const policy_table::Languages::value_type& lang) const {
return !strcasecmp(language_.c_str(), lang.first.c_str());
}
@@ -89,10 +89,12 @@ struct LanguageFinder {
};
struct PolicyTableUpdater {
- PolicyTableUpdater(const policy_table::ApplicationParams& default_params)
+ explicit PolicyTableUpdater(
+ const policy_table::ApplicationParams& default_params)
: default_params_(default_params) {}
- void operator()(policy_table::ApplicationPolicies::value_type& pt_value) {
+ void operator()(
+ policy_table::ApplicationPolicies::value_type& pt_value) const {
if (policy::kDefaultId == pt_value.second.get_string()) {
pt_value.second = default_params_;
pt_value.second.set_to_string(policy::kDefaultId);
@@ -1138,10 +1140,6 @@ bool CacheManager::GetPriority(const std::string& policy_app_id,
void CacheManager::CheckSnapshotInitialization() {
CACHE_MANAGER_CHECK_VOID();
- if (!snapshot_) {
- SDL_LOG_ERROR("Snapshot pointer is not initialized");
- return;
- }
*(snapshot_->policy_table.module_config.preloaded_pt) = false;
@@ -1309,8 +1307,6 @@ void CacheManager::PersistData() {
copy_pt.policy_table.app_policies_section.apps.end();
bool is_revoked = false;
- bool is_default_policy;
- bool is_predata_policy;
for (; app_policy_iter != app_policy_iter_end; ++app_policy_iter) {
const std::string app_id = (*app_policy_iter).first;
@@ -1321,7 +1317,7 @@ void CacheManager::PersistData() {
copy_pt.policy_table.app_policies_section.apps[app_id].is_null();
}
- is_default_policy =
+ bool is_default_policy =
copy_pt.policy_table.app_policies_section.apps.end() !=
copy_pt.policy_table.app_policies_section.apps.find(app_id) &&
policy::kDefaultId ==
@@ -1329,7 +1325,7 @@ void CacheManager::PersistData() {
.get_string();
// TODO(AOleynik): Remove this field from DB
- is_predata_policy =
+ bool is_predata_policy =
copy_pt.policy_table.app_policies_section.apps.end() !=
copy_pt.policy_table.app_policies_section.apps.find(app_id) &&
policy::kPreDataConsentId ==