fix(c++): improve const correctness

Reported by cppcheck

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
This commit is contained in:
Samuel Gaist
2024-02-13 23:07:38 +01:00
committed by poiana
parent 792bcdca18
commit 5e497a4119
37 changed files with 92 additions and 92 deletions

View File

@@ -34,7 +34,7 @@ falco_formats::~falco_formats()
}
std::string falco_formats::format_event(sinsp_evt *evt, const std::string &rule, const std::string &source,
const std::string &level, const std::string &format, std::set<std::string> &tags,
const std::string &level, const std::string &format, const std::set<std::string> &tags,
const std::string &hostname) const
{
std::string line;
@@ -101,7 +101,7 @@ std::string falco_formats::format_event(sinsp_evt *evt, const std::string &rule,
}
else
{
for (auto &tag : tags)
for (const auto &tag : tags)
{
rule_tags[rule_tags_idx++] = tag;
}
@@ -128,7 +128,7 @@ std::string falco_formats::format_event(sinsp_evt *evt, const std::string &rule,
line = full_line;
}
return line.c_str();
return line;
}
std::map<std::string, std::string> falco_formats::get_field_values(sinsp_evt *evt, const std::string &source,