use more emplace_back
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
f3fcffd6e6
commit
e7eddfc2f5
@ -448,11 +448,11 @@ namespace Jzon
|
||||
|
||||
void Object::Add(const std::string &name, Node &node)
|
||||
{
|
||||
children.push_back(NamedNodePtr(name, node.GetCopy()));
|
||||
children.emplace_back(name, node.GetCopy());
|
||||
}
|
||||
void Object::Add(const std::string &name, const Value &node)
|
||||
{
|
||||
children.push_back(NamedNodePtr(name, new Value(node)));
|
||||
children.emplace_back(name, new Value(node));
|
||||
}
|
||||
void Object::Remove(const std::string &name)
|
||||
{
|
||||
|
||||
@ -585,7 +585,7 @@ namespace Exiv2 {
|
||||
ExifKey exifKey(key);
|
||||
auto pos = findKey(exifKey);
|
||||
if (pos == end()) {
|
||||
exifMetadata_.push_back(Exifdatum(exifKey));
|
||||
exifMetadata_.emplace_back(exifKey);
|
||||
return exifMetadata_.back();
|
||||
}
|
||||
return *pos;
|
||||
|
||||
@ -265,7 +265,7 @@ namespace Exiv2 {
|
||||
IptcKey iptcKey(key);
|
||||
auto pos = findKey(iptcKey);
|
||||
if (pos == end()) {
|
||||
iptcMetadata_.push_back(Iptcdatum(iptcKey));
|
||||
iptcMetadata_.emplace_back(iptcKey);
|
||||
return iptcMetadata_.back();
|
||||
}
|
||||
return *pos;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user