Skip to content

Commit

Permalink
Implement sonarcloud suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
eduar-hte committed Apr 28, 2024
1 parent 7a679a5 commit 3ab1007
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class ReadingLogsViaRuleMessage {
m_rules(rules)
{ }

int process() {
int process() const {
pthread_t threads[NUM_THREADS];
int i;
struct data_ms dms;
Expand Down
18 changes: 9 additions & 9 deletions src/rule_with_operator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ bool RuleWithOperator::executeOperatorAt(Transaction *trans, const std::string &

void RuleWithOperator::getVariablesExceptions(Transaction *t,
variables::Variables *exclusion, variables::Variables *addition) {
for (auto &a : t->m_rules->m_exceptions.m_variable_update_target_by_tag) { // cppcheck-suppress ctunullpointer
if (containsTag(*a.first.get(), t) == false) {
for (const auto &[tag, var] : t->m_rules->m_exceptions.m_variable_update_target_by_tag) { // cppcheck-suppress ctunullpointer
if (containsTag(*tag, t) == false) {
continue;
}
Variable *b = a.second.get();
auto b = var.get();
if (dynamic_cast<variables::VariableModificatorExclusion*>(b)) {
exclusion->push_back(
dynamic_cast<variables::VariableModificatorExclusion*>(
Expand All @@ -147,11 +147,11 @@ void RuleWithOperator::getVariablesExceptions(Transaction *t,
}
}

for (auto &a : t->m_rules->m_exceptions.m_variable_update_target_by_msg) {
if (containsMsg(*a.first.get(), t) == false) {
for (const auto &[msg, var] : t->m_rules->m_exceptions.m_variable_update_target_by_msg) {
if (containsMsg(*msg, t) == false) {
continue;
}
Variable *b = a.second.get();
auto b = var.get();
if (dynamic_cast<variables::VariableModificatorExclusion*>(b)) {
exclusion->push_back(
dynamic_cast<variables::VariableModificatorExclusion*>(
Expand All @@ -161,11 +161,11 @@ void RuleWithOperator::getVariablesExceptions(Transaction *t,
}
}

for (auto &a : t->m_rules->m_exceptions.m_variable_update_target_by_id) {
if (m_ruleId != a.first) {
for (const auto &[ruleId, var] : t->m_rules->m_exceptions.m_variable_update_target_by_id) {
if (m_ruleId != ruleId) {
continue;
}
Variable *b = a.second.get();
auto b = var.get();
if (dynamic_cast<variables::VariableModificatorExclusion*>(b)) {
exclusion->push_back(
dynamic_cast<variables::VariableModificatorExclusion*>(
Expand Down

0 comments on commit 3ab1007

Please sign in to comment.