mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
CPP-gen: Don't emit extra braces if only one element
This commit is contained in:
parent
016121b6f7
commit
df65b668b7
1 changed files with 7 additions and 3 deletions
|
@ -47,10 +47,14 @@ void CPP_InitsInfo::GenerateInitializers(CPPCompile* c) {
|
||||||
if ( ++n > 1 )
|
if ( ++n > 1 )
|
||||||
c->Emit("");
|
c->Emit("");
|
||||||
|
|
||||||
|
if ( cohort.size() == 1 )
|
||||||
|
BuildCohort(c, cohort);
|
||||||
|
else {
|
||||||
c->Emit("{");
|
c->Emit("{");
|
||||||
BuildCohort(c, cohort);
|
BuildCohort(c, cohort);
|
||||||
c->Emit("},");
|
c->Emit("},");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
c->Emit("}");
|
c->Emit("}");
|
||||||
c->IndentDown();
|
c->IndentDown();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue