Skip to content

Commit c56df6d

Browse files
committed
Replace push_back with emplace_back
1 parent 5512310 commit c56df6d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

cpp2rust/converter/converter_lib.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -929,11 +929,9 @@ std::vector<SwitchArm> AnalyzeSwitchArms(clang::CompoundStmt *body) {
929929
}
930930

931931
if (auto *sc = clang::dyn_cast<clang::SwitchCase>(inner)) {
932-
arms.push_back({{GetLastStmtOfSwitchCase(sc)},
933-
label,
934-
sc,
935-
CaseChainHasDefault(sc),
936-
/*has_fallthrough=*/false});
932+
arms.emplace_back(std::vector<clang::Stmt *>{GetLastStmtOfSwitchCase(sc)},
933+
label, sc, CaseChainHasDefault(sc),
934+
/*has_fallthrough=*/false);
937935
} else if (!arms.empty()) {
938936
arms.back().body.push_back(s);
939937
}

0 commit comments

Comments
 (0)