mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
Core/Objects: Eliminate unneccessary temporary objects and double map lookups when building SMSG_UPDATE_OBJECT
(cherry picked from commit 38a209276d)
This commit is contained in:
@@ -505,15 +505,7 @@ void Object::ClearUpdateMask(bool remove)
|
||||
|
||||
void Object::BuildFieldsUpdate(Player* player, UpdateDataMapType& data_map) const
|
||||
{
|
||||
UpdateDataMapType::iterator iter = data_map.find(player);
|
||||
|
||||
if (iter == data_map.end())
|
||||
{
|
||||
std::pair<UpdateDataMapType::iterator, bool> p = data_map.emplace(player, UpdateData());
|
||||
ASSERT(p.second);
|
||||
iter = p.first;
|
||||
}
|
||||
|
||||
UpdateDataMapType::iterator iter = data_map.try_emplace(player).first;
|
||||
BuildValuesUpdateBlockForPlayer(&iter->second, iter->first);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user