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

Location:
code/branches/cpp11_v2/src/libraries/network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/network/FunctionCall.cc

    r10916 r10918  
    119119  for( unsigned int i=0; i<this->nrOfArguments_; ++i )
    120120  {
    121     this->arguments_.push_back(MultiType());
     121    this->arguments_.emplace_back();
    122122    this->arguments_.back().importData(mem);
    123123  }
  • code/branches/cpp11_v2/src/libraries/network/FunctionCallManager.cc

    r10769 r10918  
    6565void FunctionCallManager::bufferIncomingFunctionCall(const orxonox::FunctionCall& fctCall, uint32_t minGamestateID, uint32_t peerID)
    6666{
    67   FunctionCallManager::sIncomingFunctionCallBuffer_.push_back( std::make_pair(fctCall, std::make_pair(minGamestateID, peerID)));
     67  FunctionCallManager::sIncomingFunctionCallBuffer_.emplace_back(fctCall, std::make_pair(minGamestateID, peerID));
    6868}
    6969
  • code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.cc

    r10768 r10918  
    133133    tempsize = it->getData(mem, this->sizes_, id, mode);
    134134    if ( tempsize != 0 )
    135       dataVector_.push_back( obj(it->getObjectID(), it->getContextID(), tempsize, mem-data_) );
     135      dataVector_.emplace_back(it->getObjectID(), it->getContextID(), tempsize, mem-data_);
    136136
    137137#ifndef NDEBUG
Note: See TracChangeset for help on using the changeset viewer.