mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +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
|
@ -812,12 +812,10 @@ void Manager::Unpeer(const string& addr, uint16_t port) {
|
|||
}
|
||||
|
||||
bool Manager::IsOutboundPeering(const string& addr, uint16_t port) const {
|
||||
return bstate->outbound_peerings.find(broker::network_info(addr, port)) != bstate->outbound_peerings.end();
|
||||
return bstate->outbound_peerings.contains(broker::network_info(addr, port));
|
||||
}
|
||||
|
||||
bool Manager::IsOutboundPeering(const broker::network_info& ni) const {
|
||||
return bstate->outbound_peerings.find(ni) != bstate->outbound_peerings.end();
|
||||
}
|
||||
bool Manager::IsOutboundPeering(const broker::network_info& ni) const { return bstate->outbound_peerings.contains(ni); }
|
||||
|
||||
std::vector<broker::peer_info> Manager::Peers() const {
|
||||
if ( bstate->endpoint.is_shutdown() )
|
||||
|
@ -2110,7 +2108,7 @@ const Stats& Manager::GetStatistics() {
|
|||
TableValPtr Manager::GetPeeringStatsTable() { return bstate->peerBufferState->GetPeeringStatsTable(); }
|
||||
|
||||
bool Manager::AddForwardedStore(const std::string& name, TableValPtr table) {
|
||||
if ( forwarded_stores.find(name) != forwarded_stores.end() ) {
|
||||
if ( forwarded_stores.contains(name) ) {
|
||||
reporter->Error("same &broker_store %s specified for two different variables", name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
@ -2127,7 +2125,7 @@ void Manager::PrepareForwarding(const std::string& name) {
|
|||
if ( ! handle )
|
||||
return;
|
||||
|
||||
if ( forwarded_stores.find(name) == forwarded_stores.end() )
|
||||
if ( ! forwarded_stores.contains(name) )
|
||||
return;
|
||||
|
||||
handle->forward_to = forwarded_stores.at(name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue