From 12d4ed3e8c16bc5337c6a487f313f9014dabbd47 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 11 Jan 2019 11:55:42 +0000 Subject: [PATCH] Collapse 2 loop dependent variables into a single variable --- src/qt/radiobox.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 55ceb2403d..7958639d67 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -113,12 +113,11 @@ bool wxRadioBox::Create(wxWindow *parent, static void AddChoices( QButtonGroup *qtButtonGroup, QBoxLayout *qtBoxLayout, int count, const wxString choices[] ) { bool isFirst = true; - int id = 0; - while ( count-- > 0 ) + for (int i = 0; i < count; ++i ) { - QRadioButton *btn = new QRadioButton( wxQtConvertString( *choices++ )); - qtButtonGroup->addButton( btn, id++ ); + QRadioButton *btn = new QRadioButton( wxQtConvertString( choices[i] )); + qtButtonGroup->addButton( btn, i ); qtBoxLayout->addWidget( btn ); if ( isFirst )