mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-08 18:19:30 +00:00
refactor(engine): fix variable / function shadowing
Improve variable names in the code surrounding the changes. Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
This commit is contained in:
@@ -343,35 +343,35 @@ void rule_loader::compiler::compile_list_infos(
|
||||
const collector& col,
|
||||
indexed_vector<falco_list>& out) const
|
||||
{
|
||||
std::list<std::string> used;
|
||||
falco_list v;
|
||||
std::list<std::string> used_names;
|
||||
falco_list infos;
|
||||
for (const auto &list : col.lists())
|
||||
{
|
||||
v.name = list.name;
|
||||
v.items.clear();
|
||||
infos.name = list.name;
|
||||
infos.items.clear();
|
||||
for (const auto &item : list.items)
|
||||
{
|
||||
const auto ref = col.lists().at(item);
|
||||
if (ref && ref->index < list.visibility)
|
||||
{
|
||||
used.push_back(ref->name);
|
||||
used_names.push_back(ref->name);
|
||||
for (const auto &val : ref->items)
|
||||
{
|
||||
v.items.push_back(val);
|
||||
infos.items.push_back(val);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
v.items.push_back(item);
|
||||
infos.items.push_back(item);
|
||||
}
|
||||
}
|
||||
v.used = false;
|
||||
auto list_id = out.insert(v, v.name);
|
||||
infos.used = false;
|
||||
auto list_id = out.insert(infos, infos.name);
|
||||
out.at(list_id)->id = list_id;
|
||||
}
|
||||
for (const auto &v : used)
|
||||
for (const auto &name : used_names)
|
||||
{
|
||||
out.at(v)->used = true;
|
||||
out.at(name)->used = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user