Skip to content

Commit

Permalink
Avoid this unnecessary copy by using a "const" reference.
Browse files Browse the repository at this point in the history
- Reported by Sonarcloud
  • Loading branch information
eduar-hte committed Oct 19, 2024
1 parent d1e7e7b commit b0497d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/optimization/optimization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int main(int argc, char **argv) {
}

if (const auto *rwo = dynamic_cast<modsecurity::RuleWithOperator *>(z.get())) {
const auto op = rwo->getOperatorName();
const auto &op = rwo->getOperatorName();
if (operators.count(op) > 0) {
operators[op] = 1 + operators[op];
} else {
Expand Down

0 comments on commit b0497d9

Please sign in to comment.