Mod: use emplace_back

This commit is contained in:
berniev
2022-08-05 16:06:37 +10:00
committed by wwmayer
parent 6ac4d8392e
commit 2d4c5a4cfb
65 changed files with 254 additions and 265 deletions

View File

@@ -63,7 +63,7 @@ std::vector<std::string> ViewProviderProjGroup::getDisplayModes(void) const
{
// get the modes of the father
std::vector<std::string> StrList = ViewProviderDrawingView::getDisplayModes();
StrList.push_back("Drawing");
StrList.emplace_back("Drawing");
return StrList;
}
@@ -126,21 +126,21 @@ bool ViewProviderProjGroup::onDelete(const std::vector<std::string> &)
// add names to a list
if (!viewSection.empty()) {
for (auto SecIterator : viewSection) {
ViewList.push_back(SecIterator->Label.getValue());
ViewList.emplace_back(SecIterator->Label.getValue());
}
}
// get its detail views
auto viewDetail = Item->getDetailRefs();
if (!viewDetail.empty()) {
for (auto DetIterator : viewDetail) {
ViewList.push_back(DetIterator->Label.getValue());
ViewList.emplace_back(DetIterator->Label.getValue());
}
}
// get its leader lines
auto viewLead = Item->getLeaders();
if (!viewLead.empty()) {
for (auto LeadIterator : viewLead) {
ViewList.push_back(LeadIterator->Label.getValue());
ViewList.emplace_back(LeadIterator->Label.getValue());
}
}
}