@@ -179,7 +179,7 @@ ChainResetCountersOutputJsonObject Chain::resetCounters() {
179179 }
180180
181181 dynamic_cast <Firewall::DefaultAction *>(
182- programs->at (ModulesConstants::DEFAULTACTION))->flushCounters (name );
182+ programs->at (ModulesConstants::DEFAULTACTION))->flushCounters ();
183183
184184 counters_.clear ();
185185
@@ -285,8 +285,8 @@ void Chain::updateChain() {
285285 // SWAP indexes
286286 *horus_swap_ = !(*horus_swap_);
287287
288- uint8_t horus_index_new = - 1 ;
289- uint8_t horus_index_old = - 1 ;
288+ uint8_t horus_index_new;
289+ uint8_t horus_index_old;
290290
291291 // Apply Horus optimization
292292
@@ -523,7 +523,6 @@ void Chain::updateChain() {
523523 if (index == startingIndex) {
524524 firstProgramLoaded = actionlookup;
525525 }
526- ++index;
527526
528527 for (auto &rule : rules_) {
529528 actionlookup->updateTableValue (rule->getId (),
@@ -643,8 +642,7 @@ std::vector<std::shared_ptr<ChainRule>> Chain::getRuleList() {
643642 defaultRule.setDescription (" Default Policy" );
644643 defaultRule.setId (rules_.size ());
645644
646- rules.push_back (
647- std::shared_ptr<ChainRule>(new ChainRule (*this , defaultRule)));
645+ rules.push_back (std::make_shared<ChainRule>(*this , defaultRule));
648646
649647 return rules;
650648}
@@ -663,7 +661,7 @@ void Chain::addRule(const uint32_t &id, const ChainRuleJsonObject &conf) {
663661 if (newRule == nullptr ) {
664662 // Totally useless, but it is needed to avoid the compiler making wrong
665663 // assumptions and reordering
666- throw new std::runtime_error (" I won't be thrown" );
664+ throw std::runtime_error (" I won't be thrown" );
667665
668666 } else if (rules_.size () <= id && newRule != nullptr ) {
669667 rules_.resize (rules_.size () + 1 );
@@ -775,7 +773,7 @@ ChainInsertOutputJsonObject Chain::insert(ChainInsertInputJsonObject input) {
775773 if (newRule == nullptr ) {
776774 // Totally useless, but it is needed to avoid the compiler making wrong
777775 // assumptions and reordering
778- throw new std::runtime_error (" I won't be thrown" );
776+ throw std::runtime_error (" I won't be thrown" );
779777
780778 } else if (rules_.size () >= id && newRule != nullptr ) {
781779 rules_.resize (rules_.size () + 1 );
0 commit comments