mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-05 16:50:34 +00:00
update(falco): use std::include for readability
Signed-off-by: Luca Guerra <luca@guerra.sh>
This commit is contained in:
@@ -502,18 +502,10 @@ void rule_loader::compiler::compile_rule_infos(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extra.m_tags.size() != 0)
|
if (!std::includes(r.tags.begin(), r.tags.end(),
|
||||||
|
extra.m_tags.begin(), extra.m_tags.end()))
|
||||||
{
|
{
|
||||||
std::set<std::string> intersect;
|
continue;
|
||||||
|
|
||||||
set_intersection(extra.m_tags.begin(), extra.m_tags.end(),
|
|
||||||
r.tags.begin(), r.tags.end(),
|
|
||||||
inserter(intersect, intersect.begin()));
|
|
||||||
|
|
||||||
if (intersect.size() != extra.m_tags.size())
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extra.m_rule != "" && r.name != extra.m_rule)
|
if (extra.m_rule != "" && r.name != extra.m_rule)
|
||||||
@@ -551,18 +543,10 @@ void rule_loader::compiler::compile_rule_infos(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extra.m_tags.size() != 0)
|
if (!std::includes(r.tags.begin(), r.tags.end(),
|
||||||
|
extra.m_tags.begin(), extra.m_tags.end()))
|
||||||
{
|
{
|
||||||
std::set<std::string> intersect;
|
continue;
|
||||||
|
|
||||||
set_intersection(extra.m_tags.begin(), extra.m_tags.end(),
|
|
||||||
r.tags.begin(), r.tags.end(),
|
|
||||||
inserter(intersect, intersect.begin()));
|
|
||||||
|
|
||||||
if (intersect.size() != extra.m_tags.size())
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extra.m_rule != "" && r.name != extra.m_rule)
|
if (extra.m_rule != "" && r.name != extra.m_rule)
|
||||||
|
Reference in New Issue
Block a user