From 8c1a3c26af735ce9f26c9626a52c9916f755818c Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 18 Aug 2023 18:33:22 +0100 Subject: [PATCH] Use ring buffers for network _chatmsg_list and _command_queue --- src/command.cpp | 4 ++-- src/network/network_chat_gui.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index a323f5047f..63aab47545 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -34,8 +34,8 @@ #include "debug_settings.h" #include "debug_desync.h" #include "order_backup.h" +#include "core/ring_buffer.hpp" #include -#include #include "table/strings.h" @@ -638,7 +638,7 @@ struct CommandQueueItem { CommandContainer cmd; CompanyID company; }; -static std::deque _command_queue; +static ring_buffer _command_queue; void ClearCommandLog() { diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 7362c1d5dd..1601b59c42 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -22,13 +22,13 @@ #include "network_client.h" #include "network_base.h" #include "../core/format.hpp" +#include "core/ring_buffer.hpp" #include "../widgets/network_chat_widget.h" #include "table/strings.h" #include /* va_list */ -#include #include #include "../safeguards.h" @@ -48,7 +48,7 @@ struct ChatMessage { }; /* used for chat window */ -static std::deque _chatmsg_list; ///< The actual chat message list. +static ring_buffer _chatmsg_list; ///< The actual chat message list. static bool _chatmessage_dirty = false; ///< Does the chat message need repainting? static bool _chatmessage_visible = false; ///< Is a chat message visible. static bool _chat_tab_completion_active; ///< Whether tab completion is active.