From 9ebbe969c887d4fbb0c681b80eae589ce79dbd5d Mon Sep 17 00:00:00 2001 From: tycho Date: Sun, 31 May 2015 18:51:31 +0100 Subject: Made the list of chunks to stream an unordered_set This should increase performance of chunk streaming --- src/ChunkSender.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ChunkSender.cpp') diff --git a/src/ChunkSender.cpp b/src/ChunkSender.cpp index 43b65014a..5790accdb 100644 --- a/src/ChunkSender.cpp +++ b/src/ChunkSender.cpp @@ -31,7 +31,7 @@ class cNotifyChunkSender : { cChunkSender & ChunkSender = m_ChunkSender; m_World.DoWithChunk( - a_ChunkX, a_ChunkZ, + a_ChunkX, a_ChunkZ, [&ChunkSender] (cChunk & a_Chunk) -> bool { ChunkSender.QueueSendChunkTo(a_Chunk.GetPosX(), a_Chunk.GetPosZ(), cChunkSender::PRIORITY_BROADCAST, a_Chunk.GetAllClients()); @@ -161,7 +161,7 @@ void cChunkSender::RemoveClient(cClientHandle * a_Client) for (auto && pair : m_ChunkInfo) { auto && clients = pair.second.m_Clients; - clients.erase(a_Client); // nop for sets that do not contain a_Client + clients.erase(a_Client); // nop for sets that do not contain a_Client } m_RemoveCount++; @@ -222,9 +222,9 @@ void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkZ, std::unordered_setWantsSendChunk(a_ChunkX, a_ChunkZ)) + if (!(*itr)->WantsSendChunk(a_ChunkX, a_ChunkZ)) { auto toremove = itr; itr++; -- cgit v1.2.3