mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Use .contains() instead of .find() or .count()
This commit is contained in:
parent
d20550f553
commit
b592b6c998
68 changed files with 201 additions and 207 deletions
|
@ -334,7 +334,7 @@ bool RuleMatcher::ReadFiles(const std::vector<SignatureFile>& files) {
|
|||
}
|
||||
|
||||
void RuleMatcher::AddRule(Rule* rule) {
|
||||
if ( rules_by_id.find(rule->ID()) != rules_by_id.end() ) {
|
||||
if ( rules_by_id.contains(rule->ID()) ) {
|
||||
rules_error("rule defined twice");
|
||||
return;
|
||||
}
|
||||
|
@ -602,7 +602,7 @@ bool RuleMatcher::AllRulePatternsMatched(const Rule* r, MatchPos matchpos, const
|
|||
|
||||
// Check whether all patterns of the rule have matched.
|
||||
for ( const auto& pattern : r->patterns ) {
|
||||
if ( ams.find(pattern->id) == ams.end() )
|
||||
if ( ! ams.contains(pattern->id) )
|
||||
return false;
|
||||
|
||||
// See if depth is satisfied.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue