Skip to content

Commit

Permalink
Apply simplification due to no longer supporting g++ 4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
speth authored and ischoegl committed Mar 9, 2023
1 parent 399e1cb commit 36a15fc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/base/AnyMap.cpp
Expand Up @@ -1343,9 +1343,7 @@ AnyValue& AnyMap::operator[](const std::string& key)
const auto& iter = m_data.find(key);
if (iter == m_data.end()) {
// Create a new key to return
// NOTE: 'insert' can be replaced with 'emplace' after support for
// G++ 4.7 is dropped.
AnyValue& value = m_data.insert({key, AnyValue()}).first->second;
AnyValue& value = m_data.emplace(key, AnyValue()).first->second;
value.setKey(key);
if (m_metadata) {
value.propagateMetadata(m_metadata);
Expand Down Expand Up @@ -1376,9 +1374,7 @@ const AnyValue& AnyMap::operator[](const std::string& key) const

AnyValue& AnyMap::createForYaml(const std::string& key, int line, int column)
{
// NOTE: 'insert' can be replaced with 'emplace' after support for
// G++ 4.7 is dropped.
AnyValue& value = m_data.insert({key, AnyValue()}).first->second;
AnyValue& value = m_data.emplace(key, AnyValue()).first->second;
value.setKey(key);
if (m_metadata) {
value.propagateMetadata(m_metadata);
Expand Down

0 comments on commit 36a15fc

Please sign in to comment.