use emplace_back instead of push_back where justified

This commit is contained in:
asapelkin
2019-10-25 00:57:12 +03:00
committed by wmayer
parent 079808b816
commit e951094af9
67 changed files with 239 additions and 241 deletions

View File

@@ -334,8 +334,8 @@ ColorLegend::ColorLegend (void)
: _bOutsideGrayed(false)
{
// default green, red
_aclColorFields.push_back(Color(0, 1, 0));
_aclColorFields.push_back(Color(1, 0, 0));
_aclColorFields.emplace_back(0, 1, 0);
_aclColorFields.emplace_back(1, 0, 0);
_aclNames.push_back("Min");
_aclNames.push_back("Max");

View File

@@ -130,7 +130,7 @@ const boost::any Property::getPathValue(const ObjectIdentifier &path) const
void Property::getPaths(std::vector<ObjectIdentifier> &paths) const
{
paths.push_back(App::ObjectIdentifier(getContainer(), getName()));
paths.emplace_back(getContainer(), getName());
}
ObjectIdentifier Property::canonicalPath(const ObjectIdentifier &p) const

View File

@@ -245,7 +245,7 @@ void PropertyExpressionEngine::buildGraphStructures(const ObjectIdentifier & pat
int s = nodes.size();
nodes[cPath] = s;
}
edges.push_back(std::make_pair(nodes[path], nodes[cPath]));
edges.emplace_back(nodes[path], nodes[cPath]);
}
}
}

View File

@@ -1781,7 +1781,7 @@ void PropertyLinkSubList::setValue(DocumentObject* lValue, const std::vector<str
if (size == 0) {
if (lValue) {
this->_lValueList.push_back(lValue);
this->_lSubList.push_back(std::string());
this->_lSubList.emplace_back();
}
}
else {
@@ -1893,7 +1893,7 @@ std::vector<PropertyLinkSubList::SubSet> PropertyLinkSubList::getSubListValues(b
sub = _lSubList[i];
if (values.size() == 0 || values.back().first != link){
//new object started, start a new subset.
values.push_back(SubSet(link, std::vector<std::string>()));
values.emplace_back(link, std::vector<std::string>());
}
values.back().second.push_back(sub);
}