mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Use more unordered_maps to improve performance in c++11 builds
This commit is contained in:
parent
997fc59c7e
commit
667975fe3a
9 changed files with 22 additions and 27 deletions
|
@ -623,10 +623,8 @@ void Client::step(float dtime)
|
|||
Update positions of sounds attached to objects
|
||||
*/
|
||||
{
|
||||
for(std::map<int, u16>::iterator
|
||||
i = m_sounds_to_objects.begin();
|
||||
i != m_sounds_to_objects.end(); ++i)
|
||||
{
|
||||
for(UNORDERED_MAP<int, u16>::iterator i = m_sounds_to_objects.begin();
|
||||
i != m_sounds_to_objects.end(); ++i) {
|
||||
int client_id = i->first;
|
||||
u16 object_id = i->second;
|
||||
ClientActiveObject *cao = m_env.getActiveObject(object_id);
|
||||
|
@ -645,8 +643,7 @@ void Client::step(float dtime)
|
|||
m_removed_sounds_check_timer = 0;
|
||||
// Find removed sounds and clear references to them
|
||||
std::vector<s32> removed_server_ids;
|
||||
for(std::map<s32, int>::iterator
|
||||
i = m_sounds_server_to_client.begin();
|
||||
for(UNORDERED_MAP<s32, int>::iterator i = m_sounds_server_to_client.begin();
|
||||
i != m_sounds_server_to_client.end();) {
|
||||
s32 server_id = i->first;
|
||||
int client_id = i->second;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue