use emplace_back instead of push_back where justified
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user