CPP-gen: Don't emit extra braces if only one element

This commit is contained in:
Tim Wojtulewicz 2024-01-04 16:45:13 -07:00
parent 016121b6f7
commit df65b668b7

View file

@ -47,9 +47,13 @@ void CPP_InitsInfo::GenerateInitializers(CPPCompile* c) {
if ( ++n > 1 )
c->Emit("");
c->Emit("{");
BuildCohort(c, cohort);
c->Emit("},");
if ( cohort.size() == 1 )
BuildCohort(c, cohort);
else {
c->Emit("{");
BuildCohort(c, cohort);
c->Emit("},");
}
}
c->Emit("}");