mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Clang-tidy fixes for recent IDPtr changes
This commit is contained in:
parent
e3b22cd21f
commit
26ea7cc655
18 changed files with 50 additions and 51 deletions
|
@ -69,7 +69,7 @@ UsageAnalyzer::UsageAnalyzer(std::vector<FuncInfo>& funcs) {
|
|||
for ( auto& gpair : globals ) {
|
||||
auto& id = gpair.second;
|
||||
|
||||
if ( reachables.count(id) > 0 )
|
||||
if ( reachables.contains(id) )
|
||||
continue;
|
||||
|
||||
auto f = GetFuncIfAny(id);
|
||||
|
@ -119,7 +119,7 @@ public:
|
|||
TraversalCode PreID(const ID* raw_id) override {
|
||||
IDPtr id{NewRef{}, const_cast<ID*>(raw_id)};
|
||||
|
||||
if ( ids.count(id) > 0 )
|
||||
if ( ids.contains(id) )
|
||||
return TC_ABORTSTMT;
|
||||
|
||||
if ( attr_depth > 0 )
|
||||
|
@ -151,7 +151,7 @@ void UsageAnalyzer::FindSeeds(IDSet& seeds) const {
|
|||
auto f = GetFuncIfAny(id);
|
||||
|
||||
if ( f && id->GetType<FuncType>()->Flavor() == FUNC_FLAVOR_EVENT ) {
|
||||
if ( script_events.count(f->GetName()) == 0 )
|
||||
if ( ! script_events.contains(f->GetName()) )
|
||||
seeds.insert(id);
|
||||
|
||||
continue;
|
||||
|
@ -201,7 +201,7 @@ void UsageAnalyzer::FullyExpandReachables() {
|
|||
bool UsageAnalyzer::ExpandReachables(const IDSet& curr_r) {
|
||||
new_reachables.clear();
|
||||
|
||||
for ( auto r : curr_r )
|
||||
for ( const auto& r : curr_r )
|
||||
Expand(r);
|
||||
|
||||
return ! new_reachables.empty();
|
||||
|
@ -229,7 +229,7 @@ void UsageAnalyzer::Expand(const IDPtr& id) {
|
|||
TraversalCode UsageAnalyzer::PreID(const ID* raw_id) {
|
||||
IDPtr id{NewRef{}, const_cast<ID*>(raw_id)};
|
||||
|
||||
if ( analyzed_IDs.count(id) > 0 )
|
||||
if ( analyzed_IDs.contains(id) )
|
||||
// No need to repeat the analysis.
|
||||
return TC_ABORTSTMT;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue