From c79154c87b7d23bf465d973e6c62cc7549825b45 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 7 May 2023 16:11:42 +0200 Subject: [PATCH] Extract processing client broadcast messages to a separate function. --- profiler/src/main.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index e11865bf..f967353f 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -323,14 +323,8 @@ int main( int argc, char** argv ) return 0; } -static void DrawContents() +static void UpdateBroadcastClients() { - static bool reconnect = false; - static std::string reconnectAddr; - static uint16_t reconnectPort; - static bool showFilter = false; - -#ifndef __EMSCRIPTEN__ if( !view ) { const auto time = std::chrono::duration_cast( std::chrono::system_clock::now().time_since_epoch() ).count(); @@ -473,6 +467,17 @@ static void DrawContents() { clients.clear(); } +} + +static void DrawContents() +{ + static bool reconnect = false; + static std::string reconnectAddr; + static uint16_t reconnectPort; + static bool showFilter = false; + +#ifndef __EMSCRIPTEN__ + UpdateBroadcastClients(); #endif int display_w, display_h;