mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
use container empty() rather than size() where appropriate
This commit is contained in:
parent
9b2eb2c373
commit
ffd1905f90
13 changed files with 37 additions and 37 deletions
|
@ -133,7 +133,7 @@ void CPPCompile::ExpandTypeVar(const TypePtr& t)
|
|||
}
|
||||
|
||||
auto& script_type_name = t->GetName();
|
||||
if ( script_type_name.size() > 0 )
|
||||
if ( ! script_type_name.empty() )
|
||||
AddInit(t, "register_type__CPP(" + tn + ", \"" +
|
||||
script_type_name + "\");");
|
||||
|
||||
|
@ -181,7 +181,7 @@ void CPPCompile::ExpandEnumTypeVar(const TypePtr& t, string& tn)
|
|||
auto names = et->Names();
|
||||
|
||||
AddInit(t, "{ auto et = " + e_name + ";");
|
||||
AddInit(t, "if ( et->Names().size() == 0 ) {");
|
||||
AddInit(t, "if ( et->Names().empty() ) {");
|
||||
|
||||
for ( const auto& name_pair : et->Names() )
|
||||
AddInit(t, string("\tet->AddNameInternal(\"") +
|
||||
|
|
|
@ -54,7 +54,7 @@ bool CPPCompile::CheckForCollisions()
|
|||
// the name either (1) wasn't previously used, or (2) if it
|
||||
// was, it was likewise for an enum or a record.
|
||||
const auto& tn = t->GetName();
|
||||
if ( tn.size() == 0 || ! hm.HasGlobal(tn) )
|
||||
if ( tn.empty() || ! hm.HasGlobal(tn) )
|
||||
// No concern of collision since the type name
|
||||
// wasn't previously compiled.
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue