mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08:19 +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
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
void Replicate(const UDs& from) { use_defs = from->use_defs; }
|
||||
|
||||
bool HasID(const ID* id) { return use_defs.find(id) != use_defs.end(); }
|
||||
bool HasID(const ID* id) { return use_defs.contains(id); }
|
||||
|
||||
void Add(const ID* id) { use_defs.insert(id); }
|
||||
void Remove(const ID* id) { use_defs.erase(id); }
|
||||
|
@ -56,8 +56,8 @@ public:
|
|||
void Analyze();
|
||||
|
||||
// True if we've computed use-defs for the given statement.
|
||||
bool HasUsage(const Stmt* s) const { return use_defs_map.find(s) != use_defs_map.end(); }
|
||||
bool HasUsage(const StmtPtr& s) const { return HasUsage(s.get()); }
|
||||
bool HasUsage(const Stmt* s) const { return use_defs_map.contains(s); }
|
||||
|
||||
// Returns the use-defs for the given statement.
|
||||
UDs GetUsage(const Stmt* s) const { return FindUsage(s); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue