mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-05-07 13:37:46 +00:00
Refactor update_state: Simplify condition checks for Wiimote state retrieval
This commit is contained in:
parent
6dde741927
commit
4b53c173d6
1 changed files with 3 additions and 2 deletions
|
|
@ -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<wiimote_state>{};
|
||||
const auto running = wm && wm->is_running();
|
||||
const auto states = running ? wm->get_states() : std::vector<wiimote_state>{};
|
||||
|
||||
if (!wm || !wm->is_running() || index < 0 || static_cast<usz>(index) >= states.size())
|
||||
if (!running || index < 0 || static_cast<usz>(index) >= states.size())
|
||||
{
|
||||
ui->connectionStatus->setText(tr("N/A"));
|
||||
ui->buttonState->setText(tr("N/A"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue