From b214cde5b4a833e1826ec6850b95bf1938c8b0a0 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Wed, 4 Mar 2015 17:48:07 +0100 Subject: Remove Queue class which uses std::list and use native std::queue --- src/server.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/server.cpp') diff --git a/src/server.cpp b/src/server.cpp index 2587c2d89..444fbc751 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -906,7 +906,8 @@ void Server::AsyncRunStep(bool initial_step) while(m_unsent_map_edit_queue.size() != 0) { - MapEditEvent* event = m_unsent_map_edit_queue.pop_front(); + MapEditEvent* event = m_unsent_map_edit_queue.front(); + m_unsent_map_edit_queue.pop(); // Players far away from the change are stored here. // Instead of sending the changes, MapBlocks are set not sent @@ -1292,7 +1293,7 @@ void Server::onMapEditEvent(MapEditEvent *event) if(m_ignore_map_edit_events_area.contains(event->getArea())) return; MapEditEvent *e = event->clone(); - m_unsent_map_edit_queue.push_back(e); + m_unsent_map_edit_queue.push(e); } Inventory* Server::getInventory(const InventoryLocation &loc) @@ -1395,7 +1396,7 @@ void Server::peerAdded(con::Peer *peer) c.type = con::PEER_ADDED; c.peer_id = peer->id; c.timeout = false; - m_peer_change_queue.push_back(c); + m_peer_change_queue.push(c); } void Server::deletingPeer(con::Peer *peer, bool timeout) @@ -1409,7 +1410,7 @@ void Server::deletingPeer(con::Peer *peer, bool timeout) c.type = con::PEER_REMOVED; c.peer_id = peer->id; c.timeout = timeout; - m_peer_change_queue.push_back(c); + m_peer_change_queue.push(c); } bool Server::getClientConInfo(u16 peer_id, con::rtt_stat_type type, float* retval) @@ -1458,7 +1459,8 @@ void Server::handlePeerChanges() { while(m_peer_change_queue.size() > 0) { - con::PeerChange c = m_peer_change_queue.pop_front(); + con::PeerChange c = m_peer_change_queue.front(); + m_peer_change_queue.pop(); verbosestream<<"Server: Handling peer change: " <<"id="<