From 4b53c173d6a276ec7fb2d4ee76421c7ca6da7c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Hamil?= Date: Sat, 14 Feb 2026 23:00:16 +0300 Subject: [PATCH] Refactor update_state: Simplify condition checks for Wiimote state retrieval --- rpcs3/rpcs3qt/wiimote_settings_dialog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rpcs3/rpcs3qt/wiimote_settings_dialog.cpp b/rpcs3/rpcs3qt/wiimote_settings_dialog.cpp index 8cb56be8f2..9f6d1a06d6 100644 --- a/rpcs3/rpcs3qt/wiimote_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/wiimote_settings_dialog.cpp @@ -149,9 +149,10 @@ void wiimote_settings_dialog::update_state() { const int index = ui->wiimoteList->currentRow(); auto* wm = wiimote_handler::get_instance(); - const auto states = wm && wm->is_running() ? wm->get_states() : std::vector{}; + const auto running = wm && wm->is_running(); + const auto states = running ? wm->get_states() : std::vector{}; - if (!wm || !wm->is_running() || index < 0 || static_cast(index) >= states.size()) + if (!running || index < 0 || static_cast(index) >= states.size()) { ui->connectionStatus->setText(tr("N/A")); ui->buttonState->setText(tr("N/A"));