Skip to content

Commit

Permalink
Core/Objects: Eliminate unneccessary temporary objects and double map…
Browse files Browse the repository at this point in the history
… lookups when building SMSG_UPDATE_OBJECT

(cherry picked from commit 38a209276d9a6b3fb5e657711894a1b696933c59)
  • Loading branch information
Shauren committed Oct 28, 2024
1 parent df17886 commit 90db558
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/server/game/Entities/Object/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 90db558

Please sign in to comment.