diff --git a/source/Actor.cpp b/source/Actor.cpp index c5b3613a..0d918138 100644 --- a/source/Actor.cpp +++ b/source/Actor.cpp @@ -107,9 +107,8 @@ void Actor::initialize() { for (const auto& value : API::values) { - // emplace - actor_Values.insert(make_pair(value.second, Value())); - actor_BaseValues.insert(make_pair(value.second, Value())); + actor_Values.emplace(value.second, Value()); + actor_BaseValues.emplace(value.second, Value()); } #ifdef VAULTMP_DEBUG @@ -341,9 +340,8 @@ pPacket Actor::toPacket() const for (const auto& value : actor_Values) { - // emplace - values.insert(make_pair(value.first, this->GetActorValue(value.first))); - baseValues.insert(make_pair(value.first, this->GetActorBaseValue(value.first))); + values.emplace(value.first, this->GetActorValue(value.first)); + baseValues.emplace(value.first, this->GetActorBaseValue(value.first)); } pPacket pContainerNew = Container::toPacket(); diff --git a/source/GameFactory.hpp b/source/GameFactory.hpp index c2a70522..2b609daf 100644 --- a/source/GameFactory.hpp +++ b/source/GameFactory.hpp @@ -316,8 +316,7 @@ struct GameFactory::Get_ { if (it == instances.end()) result[i] = VaultException("Unknown object with NetworkID %llu", id); else - // emplace - sort.insert(make_pair(*it, i)); + sort.emplace(*it, i); ++i; } @@ -412,8 +411,7 @@ RakNet::NetworkID GameFactory::Create(Args&&... args) cs.Operate([id, type, &base]() { ++typecount[type]; - // emplace - index[id] = instances.insert(make_pair(std::move(base), type)).first; + index[id] = instances.emplace(std::move(base), type).first; }); return id; diff --git a/source/Player.cpp b/source/Player.cpp index e1dd840e..ad8a9d49 100644 --- a/source/Player.cpp +++ b/source/Player.cpp @@ -66,9 +66,8 @@ Player::~Player() noexcept void Player::initialize() { - // emplace for (auto control : API::controls) - player_Controls.insert(make_pair(control, make_pair(Value(), Value(true)))); + player_Controls.emplace(control, make_pair(Value(), Value(true))); #ifdef VAULTSERVER baseIDs.Operate([this](BaseIDTracker& baseIDs) { diff --git a/source/ServerEntry.cpp b/source/ServerEntry.cpp index f3b9b84a..e79a0627 100644 --- a/source/ServerEntry.cpp +++ b/source/ServerEntry.cpp @@ -15,8 +15,7 @@ void ServerEntry::SetServerMap(const string& map) void ServerEntry::SetServerRule(const string& rule, const string& value) { this->rules.erase(rule); - // emplace - this->rules.insert(make_pair(rule, value)); + this->rules.emplace(rule, value); } void ServerEntry::SetServerPlayers(const pair& players) diff --git a/source/packet b/source/packet index f3130581..b1edc623 160000 --- a/source/packet +++ b/source/packet @@ -1 +1 @@ -Subproject commit f31305818d2efa2e7417ccebbea961d767ad07c1 +Subproject commit b1edc62387baab8e6201c5c93fc19b13dfc88aff diff --git a/source/vaultserver/Client.cpp b/source/vaultserver/Client.cpp index f43c5799..38203540 100644 --- a/source/vaultserver/Client.cpp +++ b/source/vaultserver/Client.cpp @@ -12,9 +12,8 @@ stack Client::clientID; Client::Client(RakNetGUID guid, NetworkID player) : guid(guid), player(player) { cs.Operate([guid, this]() { - // emplace ID = clientID.top(); - clients.insert(make_pair(guid, this)); + clients.emplace(guid, this); clientID.pop(); }); }