mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +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:
@@ -852,15 +852,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(player->GetMapId()));
|
||||
ASSERT(p.second);
|
||||
iter = p.first;
|
||||
}
|
||||
|
||||
UpdateDataMapType::iterator iter = data_map.try_emplace(player, player->GetMapId()).first;
|
||||
BuildValuesUpdateBlockForPlayer(&iter->second, iter->first);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user