Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2015, 7:10:56 PM (9 years ago)
Author:
muemart
Message:

Use emplace_back instead of push_back if beneficial

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/Game.cc

    r10916 r10918  
    464464            while (pos < str.size() && str[pos] != ' ')
    465465                ++pos;
    466             stateStrings.push_back(std::make_pair(str.substr(startPos, pos - startPos), indentation));
     466            stateStrings.emplace_back(str.substr(startPos, pos - startPos), indentation);
    467467        }
    468468        if (stateStrings.empty())
    469469            ThrowException(GameState, "Emtpy GameState hierarchy provided, terminating.");
    470470        // Add element with large identation to detect the last with just an iterator
    471         stateStrings.push_back(std::make_pair(std::string(), -1));
     471        stateStrings.emplace_back(std::string(), -1);
    472472
    473473        // Parse elements recursively
Note: See TracChangeset for help on using the changeset viewer.