From dbf4a5880711c9f1bf50e929da610e21440b496d Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Mon, 16 Dec 2024 10:33:25 -0600 Subject: [PATCH] refactor --- repertory/librepertory/src/comm/packet/client_pool.cpp | 6 +++--- repertory/librepertory/src/comm/packet/packet_server.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/repertory/librepertory/src/comm/packet/client_pool.cpp b/repertory/librepertory/src/comm/packet/client_pool.cpp index 784fbef6..f56d2913 100644 --- a/repertory/librepertory/src/comm/packet/client_pool.cpp +++ b/repertory/librepertory/src/comm/packet/client_pool.cpp @@ -30,7 +30,7 @@ namespace repertory { void client_pool::pool::execute( std::uint64_t thread_id, const worker_callback &worker, const worker_complete_callback &worker_complete) { - const auto index = thread_id % pool_queues_.size(); + auto index = thread_id % pool_queues_.size(); auto job = std::make_shared(worker, worker_complete); auto &pool_queue = pool_queues_[index]; @@ -51,7 +51,7 @@ client_pool::pool::pool(std::uint8_t pool_size) { for (std::size_t i = 0U; i < pool_queues_.size(); i++) { pool_threads_.emplace_back([this]() { - const auto thread_index = thread_index_++; + auto thread_index = thread_index_++; auto &pool_queue = pool_queues_[thread_index]; auto &queue = pool_queue->queue; @@ -74,7 +74,7 @@ client_pool::pool::pool(std::uint8_t pool_size) { queue_lock.unlock(); try { - const auto result = item->work(); + auto result = item->work(); item->work_complete(result); } catch (const std::exception &e) { item->work_complete(utils::from_api_error(api_error::error)); diff --git a/repertory/librepertory/src/comm/packet/packet_server.cpp b/repertory/librepertory/src/comm/packet/packet_server.cpp index d338f0d0..5c5abb11 100644 --- a/repertory/librepertory/src/comm/packet/packet_server.cpp +++ b/repertory/librepertory/src/comm/packet/packet_server.cpp @@ -72,7 +72,7 @@ void packet_server::initialize(const uint16_t &port, uint8_t pool_size) { server_thread_ = std::make_unique([this, port, pool_size]() { tcp::acceptor acceptor(io_context_); try { - const auto endpoint = tcp::endpoint(tcp::v4(), port); + auto endpoint = tcp::endpoint(tcp::v4(), port); acceptor.open(endpoint.protocol()); acceptor.set_option(socket_base::reuse_address(true)); acceptor.bind(endpoint); @@ -148,7 +148,7 @@ void packet_server::read_packet(std::shared_ptr conn, const auto read_buffer = [&]() { std::uint32_t offset{}; while (offset < conn->buffer.size()) { - const auto bytes_read = boost::asio::read( + auto bytes_read = boost::asio::read( conn->socket, boost::asio::buffer(&conn->buffer[offset], conn->buffer.size() - offset)); if (bytes_read <= 0) {