summaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-09-08 18:29:02 +0200
committerest31 <MTest31@outlook.com>2015-09-08 21:23:09 +0200
commit1f1e14ab7fe1680eae12955929be004af7f39fe4 (patch)
treeb3886624c78b77dabe549997a641e880dbb99128 /src/environment.cpp
parentfe6575b8d38b29026adb9bf3d6226b5b3ceb4cab (diff)
downloadminetest-1f1e14ab7fe1680eae12955929be004af7f39fe4.tar.gz
minetest-1f1e14ab7fe1680eae12955929be004af7f39fe4.tar.bz2
minetest-1f1e14ab7fe1680eae12955929be004af7f39fe4.zip
Change m_client_event_queue's type to std::queue
As indicated in its name, m_client_event_queue should be a queue. Change std::list to std::queue to improve the queue's performance.
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index c337139e8..eb599668b 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -2562,7 +2562,7 @@ void ClientEnvironment::damageLocalPlayer(u8 damage, bool handle_hp)
event.type = CEE_PLAYER_DAMAGE;
event.player_damage.amount = damage;
event.player_damage.send_to_server = handle_hp;
- m_client_event_queue.push_back(event);
+ m_client_event_queue.push(event);
}
void ClientEnvironment::updateLocalPlayerBreath(u16 breath)
@@ -2570,7 +2570,7 @@ void ClientEnvironment::updateLocalPlayerBreath(u16 breath)
ClientEnvEvent event;
event.type = CEE_PLAYER_BREATH;
event.player_breath.amount = breath;
- m_client_event_queue.push_back(event);
+ m_client_event_queue.push(event);
}
/*
@@ -2604,7 +2604,7 @@ ClientEnvEvent ClientEnvironment::getClientEvent()
event.type = CEE_NONE;
else {
event = m_client_event_queue.front();
- m_client_event_queue.pop_front();
+ m_client_event_queue.pop();
}
return event;
}